drf-buzz
This is an extension of the py-buzz package.
It adds extra functionality especially for DRF. Predominately, it adds the ability to jsonify an exception
Installation
pip install drf-buzz
Usage
Add drf-buzz exception handler in settings.py:
REST_FRAMEWORK = {
...
'EXCEPTION_HANDLER': 'drf_buzz.exception_handler'
...
}
Use py-buzz exceptions in your DRF viewsets:
import drf_buzz
from rest_framework import status, viewsets
class MyException(drf_buzz.DRFBuzz):
status_code = status.BAD_REQUEST
class MyViewSet(viewsets.ViewSet):
def list(self, request):
raise MyException('Not implemented yet.')
Tests
To run the test suite execute the following command in package root folder:
python setup.py test
Metadata
Release files for drf-buzz 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drf-buzz-0.3.1.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drf_buzz-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.7 kB
Release files / drf-buzz-0.3.1.tar.gz
| Download URL | drf-buzz-0.3.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51a98d0ac875d5185eecb705bd1e8a2e9a8eb8b50edc35f22b0ab601affa9a6c
|
|
BLAKE2b-256 checksum How to use checksums |
76f3a82c77ab4cb6bd2e252980702687f1a94906f297dca6e09fdcad57060055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.7
|
Release files / drf_buzz-0.3.1-py3-none-any.whl
| Download URL | drf_buzz-0.3.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78b200911dfbfe3207d4f077bd089d873a2e1b43849211d2437494767351e93a
|
|
BLAKE2b-256 checksum How to use checksums |
4abd52dd84cde53e1e2094a148e1e94dd494a33942a001aca2b53149a9dc7d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.7
|