Skip to main content

Serve files with Django and reverse-proxies.

Project description

django-downloadview makes it easy to serve files with Django:

  • you manage files with Django (permissions, search, generation, …);

  • files are stored somewhere or generated somehow (local filesystem, remote storage, memory…);

  • django-downloadview helps you stream the files with very little code;

  • django-downloadview helps you improve performances with reverse proxies, via mechanisms such as Nginx’s X-Accel.

Example

Let’s serve a file stored in a FileField of some model:

from django.conf.urls import url, url_patterns
from django_downloadview import ObjectDownloadView
from demoproject.download.models import Document  # A model with a FileField

# ObjectDownloadView inherits from django.views.generic.BaseDetailView.
download = ObjectDownloadView.as_view(model=Document, file_field='file')

url_patterns = ('',
    url('^download/(?P<slug>[A-Za-z0-9_-]+)/$', download, name='download'),
)

Ressources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-downloadview-1.6.zip (48.2 kB view details)

Uploaded Source

File details

Details for the file django-downloadview-1.6.zip.

File metadata

File hashes

Hashes for django-downloadview-1.6.zip
Algorithm Hash digest
SHA256 f4b6e311b1b6ae7080959da45379c782bb87e7fb89a33a7de808eca69a519ab7
MD5 96f056f584ad98dbfed9a2622d5e97d8
BLAKE2b-256 3d29bfeb7b20b513c0562371329ab3f3c4bec189b20b44d9fdab1156ebbd3df2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page