Thursday, June 30, 2011

Re: giving download links

Actually, to serve the media you'll want to use any normal web server
such as Apache or Lighttpd.

In other words, Django has nothing to do with serving up those files.
The Django application only provides a means for users to upload to
the media folder. The media folder has to be configured outside of
Django to be served up by the HTTP server.


On Jun 28, 4:00 am, Herman Schistad <herman.schis...@gmail.com> wrote:
> On Tue, Jun 28, 2011 at 05:20, raj <nano.ri...@gmail.com> wrote:
> > I allow a user to upload a file, how do I now allow them to download
> > this file? I looked at the "serving static files" thing in the
> > djangoproject, but they said it causes security flaws or something.
> > Can someone help me? I couldn't find good information on google. Thank
> > you.
>
> What do you mean, you just give them the link to the file they just uploaded.
> <a href="{{ MEDIA_URL }}/images/image_to_download.jpg">Download here</a>
> Here you can use whatever template tools you have available.
>
> Serving static files are just for debugging and to be used with
> manage.py runserver, due to, as you said, security and scaling.
> You should look into mod_python, mod_wsgi, fastcgi or some other
> application, in order to serve your media files.
>
> Take a look at the documentation or the djangobook:https://docs.djangoproject.com/en/dev/howto/deployment/http://www.djangobook.com/en/beta/chapter21/
>
> Or am I missing something?
>
> --
> With regards, Herman Schistad

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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