You are right: these files should be downloadable only to authenticated 
users.. If not in the static folder, where should I store them and how to 
make them downloadable? thanks

Il giorno sabato 9 aprile 2016 19:13:12 UTC+2, Vijay Khemlani ha scritto:
>
> Your question seems to be incomplete
>
> considering you are using a login_required decorator then you also want to 
> limit access to the file
>
> If you put it in your static directory then it will be public if anyone 
> knows the URL to the file
>
> On Sat, Apr 9, 2016 at 1:56 PM, Luca Brandi <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>> I need to make something very simple but it seems all exmplesI found on 
>> the web, do not work, so I am sure this group will find the right solution 
>> (please consider I am a newbie so please be specific and detailed in your 
>> reply):
>> I just need to store a pdf file in my sytic files and have a link on a 
>> page which opens it. 
>> Best solution I found is not working...:
>> view.py:
>> @login_required
>> def pricelist (request):
>>     template='pricelist.pdf'
>>     return render (request, template ,{})
>>   
>> url.py:
>> url(r'^pricelist/$', 'aero.views.pricelist', name='pricelist'), 
>>
>> url link in the page: <a href="{{ MEDIA_URL 
>> }}/pdf/pricelistAR.pdf">Download</a>
>>
>>
>> anyone can help? thanks very much
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a0d7a435-1a46-4cee-9d04-0ade09363ae7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a0d7a435-1a46-4cee-9d04-0ade09363ae7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62f0868b-5a4e-4e0a-9f67-2d09bc5f2323%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to