django_early_return
Installation
pip install django_early_return- add
'django_early_return.EarlyReturnMiddleware'toMIDDLEWAREin your settings - optionally, add
'django_early_return'toINSTALLED_APPS, if you want to run our tests when executingpython 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)
| File | Size | Uploaded | |
|---|---|---|---|
| django_early_return-0.5.0.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|