Serve files with Django.
Find a file
2015-06-12 20:51:51 +02:00
demo Refs #98 - Workaround documentation. 2015-06-12 19:30:57 +02:00
django_downloadview Refs #97 - Code style. 2015-06-12 20:51:51 +02:00
docs Refs #98 - Workaround documentation. 2015-06-12 19:30:57 +02:00
tests Refs #98 - Added __init__ script in tests/ folder. 2015-06-12 16:52:33 +02:00
.gitignore Refs #74 - Switched to tox as test-environment manager. Added flake8 to the test suite. Dropped python 2.6 tests. Makefile no longer creates a virtualenv. 2014-02-10 01:27:14 +01:00
.travis.yml Refs #98 - Workaround travis and test requirements. 2015-06-12 20:36:17 +02:00
AUTHORS Refs #25, refs #39, refs #40, refs #42 - Big refactoring in documentation and demo: narrative documentation uses examples from demo project. 2013-10-28 16:58:18 +01:00
CHANGELOG Fixed broken link. 2014-10-28 17:14:46 +02:00
CONTRIBUTING.rst Reviewed Makefile, development environment and contributor guide. 2014-03-03 14:38:33 +01:00
INSTALL Refs #98 - Workaround documentation. 2015-06-12 19:30:57 +02:00
LICENSE Refs #74 - Switched to tox as test-environment manager. Added flake8 to the test suite. Dropped python 2.6 tests. Makefile no longer creates a virtualenv. 2014-02-10 01:27:14 +01:00
Makefile Refs #98 - Starting refresh of development environment. Work in progress. 2015-06-12 11:15:39 +02:00
MANIFEST.in Refs #74 - Switched to tox as test-environment manager. Added flake8 to the test suite. Dropped python 2.6 tests. Makefile no longer creates a virtualenv. 2014-02-10 01:27:14 +01:00
README.rst Refs #98 - Workaround documentation. 2015-06-12 19:30:57 +02:00
setup.py Refs #98 - Workaround travis and test requirements. 2015-06-12 20:36:17 +02:00
tox.ini Refs #98 - Assert tests follow PEP8. 2015-06-12 20:39:00 +02:00
VERSION Back to development: 1.7 2014-03-03 14:44:17 +01:00

###################
django-downloadview
###################

`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: http://django-downloadview.readthedocs.org
* PyPI page: http://pypi.python.org/pypi/django-downloadview
* 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
* Roadmap: https://github.com/benoitbryon/django-downloadview/milestones


.. _`Django`: https://djangoproject.com