From b06723f1cbe1fc7fb77d161aed7de2c65581da14 Mon Sep 17 00:00:00 2001 From: xli Date: Mon, 28 Jun 2021 03:55:29 +0800 Subject: [PATCH] Adding media_type in JWTAuthentication (#426) The drf render BrowsableAPIRenderer is requiring a media_type object when generating a generic form that includes a content type field, error will occur if JWTAuthentication class does't have media_type. Co-authored-by: Li Xin --- rest_framework_simplejwt/authentication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework_simplejwt/authentication.py b/rest_framework_simplejwt/authentication.py index 8dee5a532..7916e724a 100644 --- a/rest_framework_simplejwt/authentication.py +++ b/rest_framework_simplejwt/authentication.py @@ -22,6 +22,7 @@ class JWTAuthentication(authentication.BaseAuthentication): token provided in a request header. """ www_authenticate_realm = 'api' + media_type = 'application/json' def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)