A simple package for DRF errors formatting
Project description
Verbose Errors
A simple package for DRF errors formatting
Requirements
- Python 3.6.8 or newer
- Django 3.2.19 or newer
- Django Rest Framework 3.14.0 or newer
Formatting
This package provides the exception handler that formats handled DRF exceptions into verbose error response
Generic error
{
"errors": [
{
"field": null,
"messages": [
"You do not have enough permissions to perform this action"
]
}
]
}
Error related to an object field
{
"errors": [
{
"field": "name",
"messages": [
"This field is required",
"This field can not be null"
]
}
]
}
Setting up
Install this package using pip
pip install djangorestframework-verbose-errors
Register the exception handler
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'rest_framework_verbose_errors.views.exception_handler'
}
License
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
Close
Hashes for djangorestframework-verbose-errors-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | efb85c1b97c23f4c289841ba8cfe16aed009df9097b4898d1b811b5c685e5bfb |
|
MD5 | e4cc00305277b9c6c116190e86a41934 |
|
BLAKE2b-256 | 6bf11362c6b8eec11d6723aaa55d9374ae9bc0066de704e12cf9b81c38c2662d |