Skip to main content

django_early_return

Installation

  • pip install django_early_return
  • add 'django_early_return.EarlyReturnMiddleware' to MIDDLEWARE in your settings
  • optionally, add 'django_early_return' to INSTALLED_APPS, if you want to run our tests when executing python manage.py test

Usage

Any view code (or middleware code, if that middleware is installed after EarlyReturnMiddleware) can now instantiate EarlyReturn with any HttpResponse, and that response will be returned to the user:

    if not request.user.has_perm('my_app.some_permission'):
        raise django_early_return.EarlyReturn(http.HttpResponseForbidden())

For code in helper functions/middleware/etc., this is often more convenient than passing a response back to the actual view code.

Release files for django-early-return 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-early-return 0.5.0
File Size Uploaded
django_early_return-0.5.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-early-return 0.5.0
File Interpreter ABI Platform
django_early_return-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / django_early_return-0.5.0.tar.gz

Download URL django_early_return-0.5.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0e6c4541a1869ed31ca2ea80777b5f0f2da4edf2d373d3d795cbdd98738305da
BLAKE2b-256 checksum
How to use checksums
53c5d08f874a9400ffefd59893f854d07373cd26ae08021e32ffd9fa36d41764
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release files / django_early_return-0.5.0-py3-none-any.whl

Download URL django_early_return-0.5.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
705a06b91cf6093002db46a42fc56e127261d250476fdfd11f09d2bb9442407d
BLAKE2b-256 checksum
How to use checksums
35eff54fef88bf08756d7112e12b688842bd5faa5ee90e1cb4ab911349d05a9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page