From cd4a0dcf2439386d2fe0438de98e9f81d76703e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Bryon?= Date: Thu, 11 Apr 2013 15:02:45 +0200 Subject: [PATCH] Reviewed documentation. --- INSTALL | 5 +++++ README | 14 +++++++++----- docs/index.txt | 1 + docs/optimizations/index.txt | 7 +++---- docs/optimizations/nginx.txt | 4 +--- docs/views.txt | 4 ++++ 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/INSTALL b/INSTALL index f9aa018..9853057 100644 --- a/INSTALL +++ b/INSTALL @@ -15,6 +15,11 @@ pip: pip install django-downloadview +.. note:: + + Since version 1.1, django-downloadview requires Django>=1.5, which provides + StreamingHttpResponse. + There is no need to register this application in your Django's ``INSTALLED_APPS`` setting. diff --git a/README b/README index 635fd50..754786b 100644 --- a/README +++ b/README @@ -2,7 +2,9 @@ django-downloadview ################### -Django-DownloadView provides (class-based) generic download views for Django. +Django-DownloadView provides generic views to make Django serve files. +It supports delegation to the actual streaming to reverse proxies, via +mechanisms such as Nginx's X-Accel. Example, in some urls.py: @@ -22,10 +24,12 @@ Example, in some urls.py: 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. +* ``ObjectDownloadView`` to serve some file field of a model. +* ``StorageDownloadView`` to serve files in a storage, without models. +* ``PathDownloadView`` to serve files located on local filesystem, without + storage. +* ``HTTPDownloadView`` to proxy some remote URL. +* ``VirtualDownloadView`` to serve in-memory or generated files. See :doc:`views` for details. diff --git a/docs/index.txt b/docs/index.txt index 060f0f5..31ba8e5 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -7,6 +7,7 @@ Contents .. toctree:: :maxdepth: 2 + :titlesonly: demo install diff --git a/docs/optimizations/index.txt b/docs/optimizations/index.txt index 4d1d4ac..5c283db 100644 --- a/docs/optimizations/index.txt +++ b/docs/optimizations/index.txt @@ -12,6 +12,7 @@ As a result, you get increased performance: reverse proxies are more efficient than Django at serving static files. .. toctree:: + :maxdepth: 2 nginx @@ -38,9 +39,7 @@ replaces ``DownloadResponse`` intance by some :py:class:`django_downloadview.nginx.XAccelRedirectResponse`. -********** -References -********** +.. rubric:: References .. target-notes:: @@ -48,4 +47,4 @@ References .. _`contributions are welcome`: https://github.com/benoitbryon/django-downloadview/issues?labels=optimizations .. _`Django's TemplateResponse`: - https://docs.djangoproject.com/en/1.4/ref/template-response/ + https://docs.djangoproject.com/en/1.5/ref/template-response/ diff --git a/docs/optimizations/nginx.txt b/docs/optimizations/nginx.txt index a9eb83d..f54fdee 100644 --- a/docs/optimizations/nginx.txt +++ b/docs/optimizations/nginx.txt @@ -183,9 +183,7 @@ configuration VS ``alias`` in nginx configuration: in a standard configuration, they should be equal. -********** -References -********** +.. rubric:: References .. target-notes:: diff --git a/docs/views.txt b/docs/views.txt index 27d3271..a3f1c2e 100644 --- a/docs/views.txt +++ b/docs/views.txt @@ -5,6 +5,10 @@ Download views This section contains narrative overview about class-based views provided by django-downloadview. +By default, all of those views would stream the file to the client. +But keep in mind that you can setup :doc:`/optimizations/index` to delegate +actual streaming to a reverse proxy. + ****************** ObjectDownloadView