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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file calibrated-0.0.1.tar.gz.

File metadata

  • Download URL: calibrated-0.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for calibrated-0.0.1.tar.gz
Algorithm Hash digest
SHA256 04dc3ee240168617bb23f251158c980142f00cf3b32545d2ee222ff5dd8c315a
MD5 528bcd0ff3b55335918f83a8bde10723
BLAKE2b-256 72245b02305602f1dbb5a85a71db6114cb9b89d2cd7d270e63e19702c298ddd5

See more details on using hashes here.

File details

Details for the file calibrated-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: calibrated-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for calibrated-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd90224d23ed9fca4da6825e33663a707b997a1a42a09a28f75d18a37f3fe74
MD5 27c3fb9afda429d9b2cba75055ebae25
BLAKE2b-256 7ebb5b570f5212362f6f62c8dc04705fe5446a75cc32eab9ae7a4d37df602754

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