Merge pull request #3728 from karthik-suresh/Fixes-Issue3727

Import parser added to docs in API guide
This commit is contained in:
Xavier Ordoquy 2015-12-12 22:19:13 +01:00
commit dcaff71217
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,9 @@ using the `APIView` class based views.
return Response({'received data': request.data})
Or, if you're using the `@api_view` decorator with function based views.
from rest_framework.decorators import api_view
from rest_framework.decorators import parser_classes
@api_view(['POST'])
@parser_classes((JSONParser,))