Commit 82973cfa by Karthik Suresh

Import parser added to docs in API guide

Added missing import statements in code snippet of API guide.

Closes-Issue: #3727
parent 8dea1aee
...@@ -52,6 +52,9 @@ using the `APIView` class based views. ...@@ -52,6 +52,9 @@ using the `APIView` class based views.
Or, if you're using the `@api_view` decorator with function based views. 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']) @api_view(['POST'])
@parser_classes((JSONParser,)) @parser_classes((JSONParser,))
def example_view(request, format=None): def example_view(request, format=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment