mirror of
https://github.com/jazzband/django-downloadview.git
synced 2026-03-16 22:40:25 +00:00
31 lines
943 B
Text
31 lines
943 B
Text
###################
|
|
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'),
|
|
)
|
|
|
|
|
|
**********
|
|
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
|