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, filters, 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 or Apache’s X-Sendfile.
Example
Let’s serve a file stored in a file field 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'),
)
Resources
Documentation: https://django-downloadview.readthedocs.io
Code repository: https://github.com/jazzband/django-downloadview
Bugtracker: https://github.com/jazzband/django-downloadview/issues
Continuous integration: https://github.com/jazzband/django-downloadview/actions
Roadmap: https://github.com/jazzband/django-downloadview/milestones
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_downloadview-2.4.0.tar.gz
.
File metadata
- Download URL: django_downloadview-2.4.0.tar.gz
- Upload date:
- Size: 66.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83ac84b01f25a693d406146122b72f4891515629b87864cca2e887d4bcba807d |
|
MD5 | 7323266c097362f249cb847b9eefbceb |
|
BLAKE2b-256 | 1f68a360ca41e0369b4e9e9d67b35eab83a12d0ccadde2fbd43bdab7b5288e47 |
File details
Details for the file django_downloadview-2.4.0-py3-none-any.whl
.
File metadata
- Download URL: django_downloadview-2.4.0-py3-none-any.whl
- Upload date:
- Size: 36.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f6fe77aed8ca4bc8ffe238440479972f4f11b6d886ef5b2a0a852f704a703b |
|
MD5 | 32e46ceab363b27f404e34ec0d0ab233 |
|
BLAKE2b-256 | 0a511c57c65a1758ecb90a459cb8d3f00de8d6f4e7baf57df794db641405d06a |