Serve files with Django.
Find a file
2012-08-29 18:06:29 +02:00
demo Refactored generic download views. Added storage argument to DownloadView. Renamed DownloadView's 'file' argument to 'filename'. 2012-08-28 15:47:26 +02:00
django_downloadview Added attributes to ObjectDownloadView, so that it is possible to use a model as a cache for file metadata (size, mime-type, basename...). Added docstrings. 2012-08-29 18:06:29 +02:00
docs Modified the way documentation version is retrieved, so that readthedocs.org can get it. 2012-08-29 10:19:51 +02:00
.gitignore Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
AUTHORS Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
buildout.cfg Fixed tests: tests use a temporary settings.MEDIA_ROOT, so files are isolated for tests. 2012-08-28 10:13:41 +02:00
CHANGELOG Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
INSTALL Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
LICENSE Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
Makefile Introduced API documentation. Not complete yet, since docstrings are not verbose. 2012-08-29 10:11:08 +02:00
MANIFEST.in Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
README Fixed example in README. ObjectDownloadView now use 'file_field' argument instead of 'file_attribute', in order to mimic 'slug_field'. 2012-08-27 17:33:33 +02:00
setup.py Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00
VERSION Introduced project's placeholders. Work in progress. 2012-08-27 12:00:17 +02:00

###################
Django-DownloadView
###################

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

.. warning::

   This project is experimental. It may be renamed or modified without
   notices.

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'),
   )
 

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