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.

This URL has Read+Write access

name age message
file .gitignore Thu May 14 14:27:31 -0700 2009 initial commit [lincolnloop]
file LICENSE Fri May 15 08:16:50 -0700 2009 moves files to proper directory [lincolnloop]
file README.rst Fri May 15 08:19:31 -0700 2009 adds acknowledgement [lincolnloop]
directory protected_files/ Mon Jun 01 15:44:13 -0700 2009 adds ability to redirect users to login url [lincolnloop]
file setup.py Fri May 15 08:16:50 -0700 2009 moves files to proper directory [lincolnloop]
README.rst

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)