Navigation

  • index
  • modules |
  • next |
  • previous |
  • django-downloadview 1.2 documentation »
  • About django-downloadview »

Alternatives and related projects¶

This document presents other projects that provide similar or complementary functionalities. It focuses on differences with django-downloadview.

Django’s static file view¶

Django has a builtin static file view [1]. It can stream files. As explained in Django documentation, it is designed for development purposes. For production, static files’d better be served by some optimized server.

Django-downloadview can replace Django’s builtin static file view:

  • perform actions with Django when receiving download requests: check permissions, generate files, gzip, logging, signals...
  • delegate actual download to a reverse proxy for increased performance.
  • disable optimization middlewares or decorators in development, if you want to serve files with Django.

django-sendfile¶

django-sendfile [2] is a wrapper around web-server specific methods for sending files to web clients.

API is made of a single sendfile() function, which returns a download response. The download response type depends on the chosen backend, which could be Django, Lighttpd’s X-Sendfile, Nginx’s X-Accel...

It seems that django-senfile main focus is simplicity: you call the sendfile() method inside your views.

Django-downloadview main focus is reusability: you configure (or override) class-based views depending on the use case.

As of 2012-04-11, django-sendfile (version 0.3.2) seems quite popular and may be a good alternative provided you serve files that live in local filesystem, because the sendfile() method only accepts filenames relative to local filesystem (i.e. using os.path.exists).

Django-downloadview (since version 1.1) handles file wrappers, and thus allows you to serve files from more locations:

  • models,
  • storages,
  • local filesystem,
  • remote URL (using requests [3]),
  • in-memory (or generated) files (such as StringIO),
  • ... and your custom ones with little efforts.

django-private-files¶

django-private-files [4] provides utilities for controlling access to static files based on conditions you can specify within your Django application.

django-protected-files¶

django-protected-files [5] is a Django application that lets you serve protected static files via your frontend server after authorizing the user against django.contrib.auth.

As of 2012-12-10, this project seems inactive.

References

[1]https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#static-file-development-view
[2]http://pypi.python.org/pypi/django-sendfile
[3]https://pypi.python.org/pypi/requests
[4]http://pypi.python.org/pypi/django-private-files
[5]https://github.com/lincolnloop/django-protected-files

Table Of Contents

  • Demo project
  • Installation
  • Download views
  • Optimizations
  • Testing download views
  • API
  • About django-downloadview
    • Alternatives and related projects
    • License
    • Authors & contributors
    • Changelog
  • Contributing to the project

Previous topic

About django-downloadview

Next topic

License

This Page

  • Show Source

Quick search

Enter search terms or a module, class or function name.

Navigation

  • index
  • modules |
  • next |
  • previous |
  • django-downloadview 1.2 documentation »
  • About django-downloadview »
© Copyright 2012, Benoît Bryon. Created using Sphinx 1.1.3.