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 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

django_curtains-0.7.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

django_curtains-0.7.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file django_curtains-0.7.0.tar.gz.

File metadata

  • Download URL: django_curtains-0.7.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for django_curtains-0.7.0.tar.gz
Algorithm Hash digest
SHA256 faf81d3b7d6dcc7d05d1a8d50dde573da060a7040654857f88fdb0970638f8ae
MD5 e78864e2b91dd6aca60e235edbd77b11
BLAKE2b-256 60906121a348e28cd135f24aa2fbbda5b32ce4c304db04756defcbba1347a99f

See more details on using hashes here.

File details

Details for the file django_curtains-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_curtains-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28c00ded220c26b051220c78861703944281f1445dad2d81155269e6b1bb1976
MD5 b403498efc47d43b2051f0a31e6ec1dd
BLAKE2b-256 604797b5311a8e7b6b2e032bd45dc0ed12c33860562cae0b5c9e3630c1b9b8ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page