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

Uploaded Source

Built Distribution

drf_buzz-0.3.1-py3-none-any.whl (9.2 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