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.3.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distributions

exceptional_auth-0.3.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

exceptional_auth-0.3.1-py2-none-any.whl (7.7 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: exceptional_auth-0.3.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for exceptional_auth-0.3.1.tar.gz
Algorithm Hash digest
SHA256 307b4ad3ed466b9ebf57185db50d92b9fc5a3acc280c3e0614c8b5a1c14a0c14
MD5 80ba6b3409cecec73952df76d4713eb5
BLAKE2b-256 e0d79ee8a8ce5940cc8093de83489a57ac25ded6505d5189d155ce3e87ff2b8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exceptional_auth-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for exceptional_auth-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bab4340b0e3443c7844eeb002969f14a85e8a54fe273e51e87d4423723972e60
MD5 2a6524073571a437e5337d0f754f6994
BLAKE2b-256 feb2391357b5d779bbed9f133e3b1928354be1bcd5b7db4807eaf52dae762e56

See more details on using hashes here.

File details

Details for the file exceptional_auth-0.3.1-py2-none-any.whl.

File metadata

  • Download URL: exceptional_auth-0.3.1-py2-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 2
  • 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.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 173e99fdced83ae728d56e9f8da8f95c66847ccd931409519555688efa7a7056
MD5 02d782bbffca4b247bd0697fc80f57d9
BLAKE2b-256 e07f695c705af194fbe92106f14086723c8654ced3f0e546afe8c4e99e9c8219

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