forked from jazzband/django-downloadview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
41 lines (27 loc) · 1.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
###################
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.
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