Skip to main content

Middleware for only allowing access to staff members

Project description

CI Status

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 ('/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'].

curtains.middleware.ip_networks_only

Requires a list of networks in the IP_NETWORKS setting. The default is 127.0.0.0/8.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-curtains, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size django_curtains-0.5.0-py3-none-any.whl (5.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django_curtains-0.5.0.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page