Serve files with Django.
Find a file
2013-11-24 10:03:11 +01:00
demo Refs #60 - VirtualFile uses force_bytes(). Removed (wrong) patch of File.__iter__(). 2013-11-08 09:56:26 +01:00
django_downloadview Refs #43 - ObjectDownloadView.get_file() raises FileNotFound if file field does not exists or is empty. Introduced DownloadMixin.file_not_found_response(). 2013-11-24 10:03:11 +01:00
docs Refs #10 - Simplified 'alternatives' documentation: djangopackages's 'file-streaming' grid is enough to compare django-downloadview, django-private-files and django-protected-files. 2013-11-17 23:00:56 +01:00
etc Upgraded software in development environment, including zc.buildout 2.2.1 and Django 1.6. 2013-11-08 11:51:22 +01:00
tests Renamed README to README.rst. Improved setup.py readability. 2013-10-28 18:15:09 +01:00
.gitignore Enhanced buildout configuration for development environment: using crate.io, upgraded to python-termstyle 0.1.10. 2013-07-26 01:38:38 +02:00
.travis.yml Dropped support (tests) for Python 2.6. 2013-11-05 11:53:29 +01: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 Refs #7 - Urlencoded non US-ASCII characters in Content-Disposition header (file name). 2013-11-18 12:12:02 +01:00
INSTALL Refs #25, refs #39 - Simplified INSTALL, reviewed docs/settings.txt. 2013-10-21 14:35:06 +02:00
LICENSE 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
Makefile Upgraded software in development environment, including zc.buildout 2.2.1 and Django 1.6. 2013-11-08 11:51:22 +01:00
MANIFEST.in Reviewed documentation. Preparing first public release. 2012-12-04 11:47:37 +01:00
README.rst Renamed README to README.rst. Improved setup.py readability. 2013-10-28 18:15:09 +01:00
setup.py Renamed README to README.rst. Improved setup.py readability. 2013-10-28 18:15:09 +01:00
VERSION Back to development: 1.4 2013-11-08 11:31:59 +01:00

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

``django-downloadview`` makes it easy to serve files with Django:

* you manage files with Django (permissions, search, 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.


*******
Example
*******

Let's serve a file stored in a FileField 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'),
   )


**********
Ressources
**********

* 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/issues/milestones