Middleware for only allowing access to staff members
Project description
Usage
Install the module using pip install django-curtains
Add one of the included middleware to MIDDLEWARE
curtains.middleware.only_staff
Only allows access to authenticated staff members. The ONLY_STAFF_EXEMPT setting (defaults to r"^/admin|^/accounts") allows excluding URLs from the middleware.
curtains.middleware.basic_auth
Requires basic authorization to access the site. The BASIC_AUTH_CREDENTIALS setting should be set to a list containing the username and the password for basic authorization, e.g. BASIC_AUTH_CREDENTIALS = ['early', 'birds']. BASIC_AUTH_EXEMPT can be set to a regex of paths to exempt from the authorization requirement.
curtains.middleware.ip_networks_only
Requires a list of networks in the IP_NETWORKS setting. The default is 127.0.0.0/8. The IP_NETWORKS_EXEMPT setting exists.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_curtains-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b6f568f4ec3931aae09ef303a890f8f903936b24d4053af1300a63cad7363a1 |
|
MD5 | 097176d46ac72481bb93863a1857c1a0 |
|
BLAKE2b-256 | 40ace0597ff6c642c13a749dc538d60420d96fc2fb9441f18321c98bae4ed8ae |