###################
django-downloadview
###################
.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband
.. image:: https://img.shields.io/pypi/v/django-downloadview.svg
:target: https://pypi.python.org/pypi/django-downloadview
.. image:: https://img.shields.io/pypi/pyversions/django-downloadview.svg
:target: https://pypi.python.org/pypi/django-downloadview
.. image:: https://img.shields.io/pypi/djversions/django-downloadview.svg
:target: https://pypi.python.org/pypi/django-downloadview
.. image:: https://img.shields.io/pypi/dm/django-downloadview.svg
:target: https://pypi.python.org/pypi/django-downloadview
.. image:: https://github.com/jazzband/django-downloadview/workflows/Test/badge.svg
:target: https://github.com/jazzband/django-downloadview/actions
:alt: GitHub Actions
.. image:: https://codecov.io/gh/jazzband/django-downloadview/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jazzband/django-downloadview
:alt: Coverage
``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:
.. code:: python
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
* PyPI page: http://pypi.python.org/pypi/django-downloadview
* 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
.. _`Django`: https://djangoproject.com
Raw data
{
"_id": null,
"home_page": "https://django-downloadview.readthedocs.io/",
"name": "django-downloadview",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "file stream download FileField ImageField x-accel x-accel-redirect x-sendfile sendfile mod_xsendfile offload",
"author": "Beno\u00eet Bryon",
"author_email": "benoit@marmelune.net",
"download_url": "https://files.pythonhosted.org/packages/fc/b2/7182dbce076e5f95105c2ef8c0f172cc1e6c09d990604cc901661d618d82/django_downloadview-2.5.0.tar.gz",
"platform": null,
"description": "###################\ndjango-downloadview\n###################\n\n.. image:: https://jazzband.co/static/img/badge.svg\n :target: https://jazzband.co/\n :alt: Jazzband\n\n.. image:: https://img.shields.io/pypi/v/django-downloadview.svg\n :target: https://pypi.python.org/pypi/django-downloadview\n\n.. image:: https://img.shields.io/pypi/pyversions/django-downloadview.svg\n :target: https://pypi.python.org/pypi/django-downloadview\n\n.. image:: https://img.shields.io/pypi/djversions/django-downloadview.svg\n :target: https://pypi.python.org/pypi/django-downloadview\n\n.. image:: https://img.shields.io/pypi/dm/django-downloadview.svg\n :target: https://pypi.python.org/pypi/django-downloadview\n\n.. image:: https://github.com/jazzband/django-downloadview/workflows/Test/badge.svg\n :target: https://github.com/jazzband/django-downloadview/actions\n :alt: GitHub Actions\n\n.. image:: https://codecov.io/gh/jazzband/django-downloadview/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/jazzband/django-downloadview\n :alt: Coverage\n\n``django-downloadview`` makes it easy to serve files with `Django`_:\n\n* you manage files with Django (permissions, filters, generation, ...);\n\n* files are stored somewhere or generated somehow (local filesystem, remote\n storage, memory...);\n\n* ``django-downloadview`` helps you stream the files with very little code;\n\n* ``django-downloadview`` helps you improve performances with reverse proxies,\n via mechanisms such as Nginx's X-Accel or Apache's X-Sendfile.\n\n\n*******\nExample\n*******\n\nLet's serve a file stored in a file field of some model:\n\n.. code:: python\n\n from django.conf.urls import url, url_patterns\n from django_downloadview import ObjectDownloadView\n from demoproject.download.models import Document # A model with a FileField\n\n # ObjectDownloadView inherits from django.views.generic.BaseDetailView.\n download = ObjectDownloadView.as_view(model=Document, file_field='file')\n\n url_patterns = ('',\n url('^download/(?P<slug>[A-Za-z0-9_-]+)/$', download, name='download'),\n )\n\n\n*********\nResources\n*********\n\n* Documentation: https://django-downloadview.readthedocs.io\n* PyPI page: http://pypi.python.org/pypi/django-downloadview\n* Code repository: https://github.com/jazzband/django-downloadview\n* Bugtracker: https://github.com/jazzband/django-downloadview/issues\n* Continuous integration: https://github.com/jazzband/django-downloadview/actions\n* Roadmap: https://github.com/jazzband/django-downloadview/milestones\n\n.. _`Django`: https://djangoproject.com\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Serve files with Django and reverse-proxies.",
"version": "2.5.0",
"project_urls": {
"Homepage": "https://django-downloadview.readthedocs.io/"
},
"split_keywords": [
"file",
"stream",
"download",
"filefield",
"imagefield",
"x-accel",
"x-accel-redirect",
"x-sendfile",
"sendfile",
"mod_xsendfile",
"offload"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6a924df0306aa24a1f1888bca2697475491794a5d29b070104ba823f9583e5aa",
"md5": "d54ad3f073c58c16a1fa875368b214bb",
"sha256": "b9faa2e6a24ad521d19f9c16ae99010fcb921a8e9dd4e6db4972df72bdcfe726"
},
"downloads": -1,
"filename": "django_downloadview-2.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d54ad3f073c58c16a1fa875368b214bb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 36052,
"upload_time": "2025-10-28T10:35:55",
"upload_time_iso_8601": "2025-10-28T10:35:55.268180Z",
"url": "https://files.pythonhosted.org/packages/6a/92/4df0306aa24a1f1888bca2697475491794a5d29b070104ba823f9583e5aa/django_downloadview-2.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fcb27182dbce076e5f95105c2ef8c0f172cc1e6c09d990604cc901661d618d82",
"md5": "b2e07a5a41e139148cd0bb3d92e8ec8b",
"sha256": "3bf0b0694711cadb4a9c1173cb21055a3f3be14c092e132ec3d69f14b4d8fdfe"
},
"downloads": -1,
"filename": "django_downloadview-2.5.0.tar.gz",
"has_sig": false,
"md5_digest": "b2e07a5a41e139148cd0bb3d92e8ec8b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 67220,
"upload_time": "2025-10-28T10:35:40",
"upload_time_iso_8601": "2025-10-28T10:35:40.374220Z",
"url": "https://files.pythonhosted.org/packages/fc/b2/7182dbce076e5f95105c2ef8c0f172cc1e6c09d990604cc901661d618d82/django_downloadview-2.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-28 10:35:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "django-downloadview"
}