Skip to main content

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
https://travis-ci.org/unistra/django-rest-framework-custom-exceptions.svg?branch=master https://coveralls.io/repos/github/unistra/django-rest-framework-custom-exceptions/badge.svg?branch=master Code Health

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for djangorestframework-custom-exceptions, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl (11.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size djangorestframework-custom-exceptions-1.0.2.tar.gz (10.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page