No project description provided
Project description
flake8-drf
Flake8 plugin that detects some issues with your drf code. Work in progress. Currently detects places where you should use drf status constants.
Installation
pip install flake8-drf
Usage
Let's say we have the following code below:
from rest_framework import views
from rest_framework.views import Response, APIView
class AuthView(APIView):
def get(self, request):
return Response(status=200)
class PostsView(views.APIView, APIView):
def post(self, request):
return Response(status=201)
Running flake8 with the plugin will tell the following:
main.py:8:25: DRF0 Status code can be changed to constant: HTTP_200_OK
main.py:14:25: DRF0 Status code can be changed to constant: HTTP_201_CREATED
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8-drf-0.1.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for flake8_drf-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea18c898b5aad470b56685f78a4e5eb3b476086600179e7ed5ab8f8bd1f8952 |
|
MD5 | 97b83f7ccb2233de62e5e7be3859eb22 |
|
BLAKE2b-256 | ae2aaefa5d579f75ef0724489b641d9b1437507346257d622e29ebb6e8029bc3 |