Custom exceptions for Django REST Framework
Project description
Custom exceptions for django rest framework
Compatibility
Works with :
Python 2.7, 3.4, 3.5, 3.6
Django >= 1.10
Django Rest Framework >= 3.5
Installation
Install the package from pypi:
pip install djangorestframework-custom-exceptions
Add the application in your django settings:
INSTALLED_APPS = ('rest_framework_custom_exceptions',)
Configure your rest framework :
REST_FRAMEWORK = { 'EXCEPTION_HANDLER': 'rest_framework_custom_exceptions.exceptions.simple_error_handler' }
Example
The simple error handler show exceptions like this :
{ "error": "Not found" }
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file djangorestframework-custom-exceptions-1.0.2.tar.gz
.
File metadata
- Download URL: djangorestframework-custom-exceptions-1.0.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c10bb46e65803614dc7b90b1a7a5c2c6abec200711a9d19f4172e66b92839bc |
|
MD5 | da46b83f12e9870827bd5adef1842c23 |
|
BLAKE2b-256 | b25b0d5c4ce71e94e9c9fc6ce70c3bb8e88ce4f65ce83a5c7146ece3bf01b27a |
File details
Details for the file djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823116f8eb6605b1abab3e01289088d7669e3170ba397b1091534c19babfb64d |
|
MD5 | d3e9fb0295937e176c8efdf5454b100c |
|
BLAKE2b-256 | 878a5cde96396379bb4c0dd659df5acba004b2efbe8dfd7b95a2f81681c077e0 |