Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unistra/django-rest-framework-custom-exceptions
Custom exceptions for Django Rest Framework
https://github.com/unistra/django-rest-framework-custom-exceptions
Last synced: 10 days ago
JSON representation
Custom exceptions for Django Rest Framework
- Host: GitHub
- URL: https://github.com/unistra/django-rest-framework-custom-exceptions
- Owner: unistra
- License: gpl-2.0
- Created: 2015-05-19T17:20:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-21T10:14:46.000Z (almost 5 years ago)
- Last Synced: 2024-10-21T15:51:23.118Z (27 days ago)
- Language: Python
- Size: 13.7 KB
- Stars: 7
- Watchers: 21
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
django-rest-custom-exceptions
======================================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.. image:: https://travis-ci.org/unistra/django-rest-framework-custom-exceptions.svg?branch=master
:target: https://travis-ci.org/unistra/django-rest-framework-custom-exceptions.. image:: https://coveralls.io/repos/github/unistra/django-rest-framework-custom-exceptions/badge.svg?branch=master
:target: https://coveralls.io/github/unistra/django-rest-framework-custom-exceptions?branch=master.. image:: https://landscape.io/github/unistra/django-rest-framework-custom-exceptions/master/landscape.svg?style=flat
:target: https://landscape.io/github/unistra/django-rest-framework-custom-exceptions/master
:alt: Code HealthInstallation
------------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"
}