File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change 11from rest_framework import parsers , renderers
22from rest_framework .authtoken .models import Token
33from rest_framework .authtoken .serializers import AuthTokenSerializer
4- from rest_framework .compat import coreapi , coreschema
54from rest_framework .response import Response
6- from rest_framework .schemas import ManualSchema
7- from rest_framework .schemas import coreapi as coreapi_schema
85from rest_framework .views import APIView
96
107
@@ -15,31 +12,6 @@ class ObtainAuthToken(APIView):
1512 renderer_classes = (renderers .JSONRenderer ,)
1613 serializer_class = AuthTokenSerializer
1714
18- if coreapi_schema .is_enabled ():
19- schema = ManualSchema (
20- fields = [
21- coreapi .Field (
22- name = "username" ,
23- required = True ,
24- location = 'form' ,
25- schema = coreschema .String (
26- title = "Username" ,
27- description = "Valid username for authentication" ,
28- ),
29- ),
30- coreapi .Field (
31- name = "password" ,
32- required = True ,
33- location = 'form' ,
34- schema = coreschema .String (
35- title = "Password" ,
36- description = "Valid password for authentication" ,
37- ),
38- ),
39- ],
40- encoding = "application/json" ,
41- )
42-
4315 def get_serializer_context (self ):
4416 return {
4517 'request' : self .request ,
You can’t perform that action at this time.
0 commit comments