Skip to main content

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


Download files

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

Source Distribution

universal_response_mobile_api-0.1.9.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

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