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
Close
Hashes for djangorestframework-custom-exceptions-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c10bb46e65803614dc7b90b1a7a5c2c6abec200711a9d19f4172e66b92839bc |
|
MD5 | da46b83f12e9870827bd5adef1842c23 |
|
BLAKE2b-256 | b25b0d5c4ce71e94e9c9fc6ce70c3bb8e88ce4f65ce83a5c7146ece3bf01b27a |
Close
Hashes for djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823116f8eb6605b1abab3e01289088d7669e3170ba397b1091534c19babfb64d |
|
MD5 | d3e9fb0295937e176c8efdf5454b100c |
|
BLAKE2b-256 | 878a5cde96396379bb4c0dd659df5acba004b2efbe8dfd7b95a2f81681c077e0 |