###################
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/1f/68/a360ca41e0369b4e9e9d67b35eab83a12d0ccadde2fbd43bdab7b5288e47/django_downloadview-2.4.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.4.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": "",
"digests": {
"blake2b_256": "0a511c57c65a1758ecb90a459cb8d3f00de8d6f4e7baf57df794db641405d06a",
"md5": "32e46ceab363b27f404e34ec0d0ab233",
"sha256": "e7f6fe77aed8ca4bc8ffe238440479972f4f11b6d886ef5b2a0a852f704a703b"
},
"downloads": -1,
"filename": "django_downloadview-2.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "32e46ceab363b27f404e34ec0d0ab233",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 36046,
"upload_time": "2024-08-06T07:28:25",
"upload_time_iso_8601": "2024-08-06T07:28:25.302366Z",
"url": "https://files.pythonhosted.org/packages/0a/51/1c57c65a1758ecb90a459cb8d3f00de8d6f4e7baf57df794db641405d06a/django_downloadview-2.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f68a360ca41e0369b4e9e9d67b35eab83a12d0ccadde2fbd43bdab7b5288e47",
"md5": "7323266c097362f249cb847b9eefbceb",
"sha256": "83ac84b01f25a693d406146122b72f4891515629b87864cca2e887d4bcba807d"
},
"downloads": -1,
"filename": "django_downloadview-2.4.0.tar.gz",
"has_sig": false,
"md5_digest": "7323266c097362f249cb847b9eefbceb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 66931,
"upload_time": "2024-08-06T07:27:46",
"upload_time_iso_8601": "2024-08-06T07:27:46.372667Z",
"url": "https://files.pythonhosted.org/packages/1f/68/a360ca41e0369b4e9e9d67b35eab83a12d0ccadde2fbd43bdab7b5288e47/django_downloadview-2.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-06 07:27:46",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "django-downloadview"
}