django-downloadview/README

48 lines
1.6 KiB
Text
Raw Normal View History

###################
django-downloadview
###################
2013-04-11 13:02:45 +00:00
Django-DownloadView provides generic views to make Django serve files.
It supports delegation to the actual streaming to reverse proxies, via
mechanisms such as Nginx's X-Accel.
Example, in some urls.py:
.. code-block:: 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'),
)
Several views are provided to cover frequent use cases:
2013-04-11 13:02:45 +00:00
* ``ObjectDownloadView`` to serve some file field of a model.
* ``StorageDownloadView`` to serve files in a storage, without models.
* ``PathDownloadView`` to serve files located on local filesystem, without
storage.
* ``HTTPDownloadView`` to proxy some remote URL.
* ``VirtualDownloadView`` to serve in-memory or generated files.
See :doc:`views` for details.
Then get increased performances with :doc:`optimizations/index`.
**********
Ressources
**********
2013-03-20 15:27:58 +00:00
* Documentation: http://django-downloadview.readthedocs.org
* PyPI page: http://pypi.python.org/pypi/django-downloadview
2013-03-20 15:27:58 +00:00
* Code repository: https://github.com/benoitbryon/django-downloadview
* Bugtracker: https://github.com/benoitbryon/django-downloadview/issues
* Continuous integration: https://travis-ci.org/benoitbryon/django-downloadview