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.

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

Hashes for djangorestframework-custom-exceptions-1.0.2.tar.gz
Algorithm Hash digest
SHA256 5c10bb46e65803614dc7b90b1a7a5c2c6abec200711a9d19f4172e66b92839bc
MD5 da46b83f12e9870827bd5adef1842c23
BLAKE2b-256 b25b0d5c4ce71e94e9c9fc6ce70c3bb8e88ce4f65ce83a5c7146ece3bf01b27a

See more details on using hashes here.

File details

Details for the file djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for djangorestframework_custom_exceptions-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 823116f8eb6605b1abab3e01289088d7669e3170ba397b1091534c19babfb64d
MD5 d3e9fb0295937e176c8efdf5454b100c
BLAKE2b-256 878a5cde96396379bb4c0dd659df5acba004b2efbe8dfd7b95a2f81681c077e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page