Skip to main content

This middleware gives same structure in django success and error case.

Project description

Calibrated!

This is a middleware for django which gives same structure in django success and error case.

When frontend softwares integrate apis, then they expect response structure should remain same in case of both error and success. By adding this middleware onne can achive sam structure through out.

{ "status": false, "detail": {}, "error_detail": { } }

The above payload is the structure which one can recive by applying the package to django appliaction.

Description to payload

  • status field can be true or false in success and error case respectively
  • detail field will always be in form of dict and will hold value only in case of success(2xx)
  • error_detail will have detail in cases excluding (2xx)

Steps to install

This is quite easy to use

pip install calibrated

After installing pip package, go to you django settings and add middeware

calibrated.Response

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

calibrated-0.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

calibrated-0.0.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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