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

Uploaded Source

Built Distribution

exceptional_auth-0.2.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for exceptional_auth-0.2.1.tar.gz
Algorithm Hash digest
SHA256 543539c117fc716dc9b0750769dcb55ba078e584b3774345d9d256baf41faa66
MD5 4aca6892549ae25c65d7030b20b78067
BLAKE2b-256 5e46df614de33407352f75a551b7fae23af97ac77d2ae60d2b752b5850fa8580

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for exceptional_auth-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a40304b1a3d5d1b14f1a658701a8546d454112b42ebb350e790745eec94403a2
MD5 2f87d258761be4876180014408e4de3f
BLAKE2b-256 28c2ead0fff04ab0141b86df0e289c250d0cf35c5d9010a4dadebd8e30b58b5d

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