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.
- Host: GitHub
- URL: https://github.com/lincolnloop/django-protected-files
- Owner: lincolnloop
- License: bsd-3-clause
- Created: 2009-05-15T15:15:29.000Z (about 17 years ago)
- Default Branch: master
- Last Pushed: 2009-06-01T22:50:40.000Z (about 17 years ago)
- Last Synced: 2025-04-13T04:41:56.223Z (about 1 year ago)
- Language: Python
- Homepage: http://github.com/lincolnloop/django-protected-files
- Size: 71.3 KB
- Stars: 32
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
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/