###################
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": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"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/a8/1c/cc1d3a1abf52d52c631b920d2f99fb7038c85053192f4185e39cd6aef072/django-downloadview-2.3.0.tar.gz",
"platform": "",
"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\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Serve files with Django and reverse-proxies.",
"version": "2.3.0",
"split_keywords": [
"file",
"stream",
"download",
"filefield",
"imagefield",
"x-accel",
"x-accel-redirect",
"x-sendfile",
"sendfile",
"mod_xsendfile",
"offload"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7eb720946e245a5555150f0f51e25d9b",
"sha256": "ad0dd0250f471f2de5d3d5355648ecb8c9f19d13e0a93c13238a111a20828fbb"
},
"downloads": -1,
"filename": "django_downloadview-2.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7eb720946e245a5555150f0f51e25d9b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35973,
"upload_time": "2022-01-11T09:44:19",
"upload_time_iso_8601": "2022-01-11T09:44:19.744008Z",
"url": "https://files.pythonhosted.org/packages/c0/1a/af5739ee36e1876be1b24e6071ac12d3ed384bef78b106cdd3e671252e49/django_downloadview-2.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "afcc6ca55a4a7a0cfc65ff1bfa7cd2d9",
"sha256": "9abaa054a349143fa07107788bd8b59dfcee045e16805e05d2fb305142fac481"
},
"downloads": -1,
"filename": "django-downloadview-2.3.0.tar.gz",
"has_sig": false,
"md5_digest": "afcc6ca55a4a7a0cfc65ff1bfa7cd2d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 64854,
"upload_time": "2022-01-11T09:44:32",
"upload_time_iso_8601": "2022-01-11T09:44:32.279817Z",
"url": "https://files.pythonhosted.org/packages/a8/1c/cc1d3a1abf52d52c631b920d2f99fb7038c85053192f4185e39cd6aef072/django-downloadview-2.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-01-11 09:44:32",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "django-downloadview"
}