Serve files with Django.
Find a file
2013-02-06 20:37:50 +01:00
demo Refs #23 - Implemented VirtualDownloadView and VirtualFile for basic support of in-memory (StringIO) or other generated files. 2013-02-06 20:11:42 +01:00
django_downloadview Refs #23 - Implemented VirtualDownloadView and VirtualFile for basic support of in-memory (StringIO) or other generated files. 2013-02-06 20:11:42 +01:00
docs Merge pull request #24 from novagile/23-file-wrapper 2013-02-06 11:16:54 -08:00
etc Updated buildout configuration. Added tests around documentation with sphinxcontrib-testbuild. 2013-02-06 15:32:29 +01:00
.gitignore Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
AUTHORS Added Rémy to AUTHORS. 2013-02-06 09:12:16 +01:00
CHANGELOG Refs #23 - Implemented and tested StorageDownloadView. This StorageDownloadView is to replace an use case of former DownloadView. 2013-02-06 19:02:43 +01:00
INSTALL Reviewed documentation. Preparing first public release. 2012-12-04 11:47:37 +01:00
LICENSE Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
Makefile Updated buildout configuration. Added tests around documentation with sphinxcontrib-testbuild. 2013-02-06 15:32:29 +01:00
MANIFEST.in Reviewed documentation. Preparing first public release. 2012-12-04 11:47:37 +01:00
README Refs #23 - Implemented VirtualDownloadView and VirtualFile for basic support of in-memory (StringIO) or other generated files. 2013-02-06 20:11:42 +01:00
setup.py Minor review of packaging. Added dependency to setuptools. 2013-02-06 20:37:50 +01:00
VERSION Fixed development version number. 2012-12-10 11:43:41 +01:00

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

Django-DownloadView provides (class-based) generic download views for Django.

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:

* ``ObjectDownloadView`` when you have a model with a file field.
* ``StorageDownloadView`` when you manage files in a storage.
* ``PathDownloadView`` when you have an absolute filename on local filesystem.
* ``VirtualDownloadView`` when you the file is generated on the fly.

See :doc:`views` for details.

Then get increased performances with :doc:`optimizations/index`.
 

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

* online 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