django-downloadview/README.rst

48 lines
1.5 KiB
ReStructuredText
Raw Normal View History

###################
django-downloadview
###################
2013-10-21 12:30:41 +00:00
``django-downloadview`` makes it easy to serve files with Django:
2013-10-21 12:30:41 +00:00
* you manage files with Django (permissions, search, generation, ...);
2013-04-11 13:42:28 +00:00
2013-10-21 12:30:41 +00:00
* 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.
2013-04-11 13:42:28 +00:00
*******
Example
*******
2013-10-21 12:30:41 +00:00
Let's serve a file stored in a FileField of some model:
2013-10-21 12:30:41 +00:00
.. 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'),
)
**********
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
2013-10-21 12:30:41 +00:00
* Roadmap: https://github.com/benoitbryon/django-downloadview/issues/milestones