Django-DownloadView

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

Example, in some urls.py:

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

Indices and tables

Table Of Contents

Next topic

Demo project

This Page