Skip to main content

No project description provided

Project description

Build Status Coverage Status

drf-buzz

This is an extension of the py-buzz package.

It adds extra functionality especially for DRF. Predominately, it adds the ability to jsonify an exception

Installation

pip install drf-buzz

Usage

Add drf-buzz exception handler in settings.py:

REST_FRAMEWORK = {
    ...
    'EXCEPTION_HANDLER': 'drf_buzz.exception_handler'
    ...
}

Use py-buzz exceptions in your DRF viewsets:

import drf_buzz

from rest_framework import status, viewsets


class MyException(drf_buzz.DRFBuzz):
    status_code = status.BAD_REQUEST


class MyViewSet(viewsets.ViewSet):
    def list(self, request):
        raise MyException('Not implemented yet.')

Tests

To run the test suite execute the following command in package root folder:

python setup.py test

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

drf-buzz-0.3.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

drf_buzz-0.3.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file drf-buzz-0.3.1.tar.gz.

File metadata

  • Download URL: drf-buzz-0.3.1.tar.gz
  • Upload date:
  • Size: 6.5 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.44.1 CPython/3.6.7

File hashes

Hashes for drf-buzz-0.3.1.tar.gz
Algorithm Hash digest
SHA256 51a98d0ac875d5185eecb705bd1e8a2e9a8eb8b50edc35f22b0ab601affa9a6c
MD5 d396e9c99517ff023796de9ecca45b24
BLAKE2b-256 76f3a82c77ab4cb6bd2e252980702687f1a94906f297dca6e09fdcad57060055

See more details on using hashes here.

File details

Details for the file drf_buzz-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: drf_buzz-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.44.1 CPython/3.6.7

File hashes

Hashes for drf_buzz-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78b200911dfbfe3207d4f077bd089d873a2e1b43849211d2437494767351e93a
MD5 e6c25af039d7f3efedd8dee9bf7003ef
BLAKE2b-256 4abd52dd84cde53e1e2094a148e1e94dd494a33942a001aca2b53149a9dc7d6e

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