An open API service indexing awesome lists of open source software.

https://github.com/lincolnloop/django-protected-files

A Django application that lets you serve protected static files via your frontend server after authorizing the user against django.contrib.auth.
https://github.com/lincolnloop/django-protected-files

Last synced: about 1 year ago
JSON representation

A Django application that lets you serve protected static files via your frontend server after authorizing the user against django.contrib.auth.

Awesome Lists containing this project

README

          

Install
-------

* ``python setup.py install``

Usage
-----

* add ``protected_files`` to your ``INSTALLED_APPS``
* add an URL to your protected resource to your ``urls.py`` (see ``tests.urls`` for examples)
* configure your static server

Static Server Configuration
---------------------------

Nginx
^^^^^

Place this in your Nginx configuration::

# this location will only be used by your Django application server
location /protected {
internal;
alias /protected/files/path/;
}

To Do
-----

* Support alternative means of authorization (user, group, is_staff, etc.)
* Support additional static servers (Lighttpd)

Acknowledgements
----------------

Based on http://www.djangosnippets.org/snippets/491/