Wednesday, November 28, 2012

Re: Where to put PDF files + how to authenticate the urls requesting them

Thanks for the reply, but I am still new to the web technology world, so I would like to fully use Django now before , moving to another ways to host my files.
Actually I am totally new to serving stuff, so if there is some best practice or that my way is totally wrong, please tell me.

So in short: is there a way to provide some kind of authentication against /static/whatever urls ? Because I want Django to host the file now
Also,  assuming I found someway to do this, django says that to mark a file as downloadable, we can do this 


>>> response = HttpResponse(my_data, content_type='application/vnd.ms-excel')  >>> response['Content-Disposition'] = 'attachment; filename="foo.xls"'

Now what is the type of my_data? any file object ?

Thanks a lot.

On Wednesday, November 28, 2012 5:08:11 PM UTC+2, Javier Guerra wrote:
On Wed, Nov 28, 2012 at 10:03 AM, Javier Guerra Giraldez
<jav...@guerrag.com> wrote:
> i think there are a couple Django apps that help with that, while also
> abstracting the differences between servers.

found these:

https://gist.github.com/1776202
https://github.com/johnsensible/django-sendfile


--
Javier

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/5lsWnXK9eRQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment