Serving external files with Django

147 views
Skip to first unread message

Priyesh Raj

unread,
Jan 2, 2017, 12:38:28 PM1/2/17
to django...@googlegroups.com
Hi,

I need to serve content of external files on user action (Click on URL). The files are PDF and are not part of media or static files.

How can I serve them in Django? Is there any built in way to handle it?

Thanks

Constantine Covtushenko

unread,
Jan 2, 2017, 2:18:29 PM1/2/17
to django...@googlegroups.com
Hi Priyesh,

You can start from managing files documentation of Django.

Hope that helps

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/CAOMjGk-7iQmg%3DKwzUJ2vgYryb4ODFnmRfLdHJFC8wPKeVW0hqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Brian Witte

unread,
Jan 2, 2017, 4:21:30 PM1/2/17
to Django users
Hi Priyesh,

Do you know what volume of files you expect to serve?  The answer to this question will be different depending on where the files are hosted.  If you expect a low volume of downloads, it might be easiest to just host the files on dropbox or even served from your own db.  If you expect a lot of downloads, a cloud-based solution is probably a better option. The django-boto-s3 package has good documentation for using Amazon's cloud storage: http://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

Antonis Christofides

unread,
Jan 3, 2017, 5:18:14 AM1/3/17
to django...@googlegroups.com

Hello,

(This is probably not what you mean, but PDF files can perfectly be considered to be "media files". The term "media" is a bit suboptimal—in Django parlance it refers to any files that are uploaded by the user or anyway are conceptually part of the database.)

If what you want to do is serve files through Django instead of directly through the web server (the common use case for this is when you want to check permissions before allowing downloads), check these links:

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

--
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 django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages