From 62b92eb4c25ab36a42beff7243d4d01c090e802f Mon Sep 17 00:00:00 2001 From: Jwpe Date: Fri, 29 May 2015 10:21:44 -0400 Subject: [PATCH] Removed parser_classes and renderer_classes from JSONWebTokenAPIView --- docs/index.md | 8 -------- rest_framework_jwt/settings.py | 5 ----- rest_framework_jwt/views.py | 3 --- 3 files changed, 16 deletions(-) diff --git a/docs/index.md b/docs/index.md index 43e99dd6..b5300ec4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -149,10 +149,6 @@ JWT_AUTH = { 'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7), 'JWT_AUTH_HEADER_PREFIX': 'JWT', - - 'JWT_DEFAULT_RENDERER_CLASSES': ( - 'rest_framework.renderers.JSONRenderer', - ), } ``` This packages uses the JSON Web Token Python implementation, [PyJWT](https://github.com/jpadilla/pyjwt) and allows to modify some of it's available options. @@ -238,10 +234,6 @@ Another common value used for tokens and Authorization headers is `Bearer`. Default is `JWT`. -### JWT_DEFAULT_RENDERER_CLASSES - -An iterable containing the renderer classes that will be applied to the responses from JWT views. If you want to modify the data structure of your responses, this is the best way to do so. Renderers are explained in detail in the [Django REST Framework documentation](http://www.django-rest-framework.org/api-guide/renderers/). - ## Extending `JSONWebTokenAuthentication` Right now `JSONWebTokenAuthentication` assumes that the JWT will come in the header. The JWT spec does not require this (see: [Making a service Call](https://developer.atlassian.com/static/connect/docs/concepts/authentication.html)). For example, the JWT may come in the querystring. The ability to send the JWT in the querystring is needed in cases where the user cannot set the header (for example the src element in HTML). diff --git a/rest_framework_jwt/settings.py b/rest_framework_jwt/settings.py index 3d74a005..178b4f21 100644 --- a/rest_framework_jwt/settings.py +++ b/rest_framework_jwt/settings.py @@ -35,10 +35,6 @@ 'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7), 'JWT_AUTH_HEADER_PREFIX': 'JWT', - - 'JWT_DEFAULT_RENDERER_CLASSES': ( - 'rest_framework.renderers.JSONRenderer', - ), } # List of settings that may be in string import notation. @@ -48,7 +44,6 @@ 'JWT_PAYLOAD_HANDLER', 'JWT_PAYLOAD_GET_USER_ID_HANDLER', 'JWT_RESPONSE_PAYLOAD_HANDLER', - 'JWT_DEFAULT_RENDERER_CLASSES', ) api_settings = APISettings(USER_SETTINGS, DEFAULTS, IMPORT_STRINGS) diff --git a/rest_framework_jwt/views.py b/rest_framework_jwt/views.py index 35a05536..d7200ace 100644 --- a/rest_framework_jwt/views.py +++ b/rest_framework_jwt/views.py @@ -1,6 +1,5 @@ from rest_framework.views import APIView from rest_framework import status -from rest_framework import parsers from rest_framework.response import Response from rest_framework_jwt.settings import api_settings @@ -20,8 +19,6 @@ class JSONWebTokenAPIView(APIView): throttle_classes = () permission_classes = () authentication_classes = () - parser_classes = (parsers.FormParser, parsers.JSONParser,) - renderer_classes = api_settings.JWT_DEFAULT_RENDERER_CLASSES def get_serializer_context(self): """