Add universal response for your API
Project description
Library for django rest framework
Repository: https://bitbucket.org/anmv/universal-response-mobile-api
PIP package: https://pypi.org/project/universal-response-mobile-api/
Install
pip install universal-response-mobile-api
Use
import universal_response_mobile_api as u_mobile_api
1. Decorator
Add your Django project, for default behavior:
file: settings.py
import universal_response_mobile_api as u_mobile_api
'DEFAULT_RENDERER_CLASSES': (
'u_mobile_api.StructuredJsonRenderer',
),
or use as decorator for rest-api.
2. Errors handler
Add your Django project:
file: settings.py
import universal_response_mobile_api as u_mobile_api
REST_FRAMEWORK = {
...
'EXCEPTION_HANDLER': 'u_mobile_api.custom_exception_handler',
...
}
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 universal_response_mobile_api-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6da30ff669ad7e754e14fff67d50cbc0feea9660f8273e6ad645badb6931e2b |
|
MD5 | b105257c7594e57e7ed50321b0c53417 |
|
BLAKE2b-256 | 5e0888eb6ec2edc2f87226958f81e7b09715d1bea4cbd8799a5f50369c7bc7e3 |
Close
Hashes for universal_response_mobile_api-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a151f3d62075cb2f39f9aa1acfc36cb78548111ee79e3f447b8ac9ffa3b840e0 |
|
MD5 | f5046862a4895011feb420c20a8cc01d |
|
BLAKE2b-256 | f2ae2b06771572c359eed3520bfbac0d48da55fc1c03a803b6c362e281722a3c |