django-site-access¶
Development¶
The source repository can be found at https://github.com/pinax/django-site-access/
Contents¶
Installation¶
To install
pip install django-site-access
Add
'django-site-access'
to yourINSTALLED_APPS
setting:INSTALLED_APPS = ( # other apps "site_access", )
Usage¶
Using django-site-access is pretty simple:
Add the middleware to your settings:
MIDDLEWARE_CLASSES = [ ... "django.middleware.common.CommonMiddleware", "site_access.middleware.BasicAuthMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", .... ]
Configure the settings:
SITE_ACCESS_SETTINGS = { "basic-auth": { "domain": "staging.yoursite.com", "realm": "MyStagingSite", "username": "someshareduser", "password": "somenotsosecretpassword" } }