Skip to main content

Exception-based authentication helpers for django

Project description

exceptional_auth

The purpose of this package is to provide a more flexible/powerful replacement for Django's login_required and permission_required decorators (and provide some entirely new related functionality).

The idea is to create a standard set of exceptions which any code can raise (even reusable apps distributed on pypi), and leave the handling of these exceptions up to the site developer (via custom middleware). This makes the many per-view decisions easy (ie. just raise PermissionDenied), while letting you centralize/delay the decision of what to do in those situations. Since you have access to the request object in the middleware methods, you can easily tailor the handling of these exceptions base on section of site, request type, etc.

We provide exceptional_auth.BaseMiddleware, a Middleware base class which makes it easier to handle our exceptions. Site developers should write a custom middleware extending this class, and add to MIDDLEWARE setting. You can also use exceptional_auth.BaseMiddleware to start with, and then extend it later.

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

exceptional_auth-0.6.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exceptional_auth-0.6.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file exceptional_auth-0.6.0.tar.gz.

File metadata

  • Download URL: exceptional_auth-0.6.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.10.1 urllib3/1.26.7 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for exceptional_auth-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b81ec83b08dad46d3710bac4d44364575de83a74212d2448d6504a397819f15c
MD5 bb6b5763d98c14768770c8fdacced3a4
BLAKE2b-256 dfeaa7a3274c96a88a3e3449847d15bf4dcf1fbe2d2509a7763f809355953ff7

See more details on using hashes here.

File details

Details for the file exceptional_auth-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: exceptional_auth-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.10.1 urllib3/1.26.7 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for exceptional_auth-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a60e2e36e4fae1514898abf62752462d33e2ff6183a8649f6825430131d739d
MD5 0c29ffe97e766ec6b922ec2a03b1531c
BLAKE2b-256 54550f6b2ce41c002708d0167b8b4c72efdad5a22d6d9270a960b59d531f7da0

See more details on using hashes here.

Supported by

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