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.

Source Distribution

django_curtains-0.5.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_curtains-0.5.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for django_curtains-0.5.0.tar.gz
Algorithm Hash digest
SHA256 53e2061c676c0e5438161f6715a860d06a1ecb8b398d05b92356a5808d3aea08
MD5 bdd8c2bd9baccf01a2f6e002304dab95
BLAKE2b-256 61e9fdee1f0a1183343279ab75ce4f2a704f1f975bcfa6b451b59850c64e7dd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_curtains-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for django_curtains-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 585734421ba5e7d07e6aa6420aee02c0297e4fb6cb74a1cda5aed466fe6d6298
MD5 f8b46194099bb0a043c6f6a90b2a31f1
BLAKE2b-256 8539b80d39d40eac30735e94824b20a571cb58782fad535d329d26e43bb58287

See more details on using hashes here.

Supported by

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