mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 11:33:59 +03:00
import permission_classes
many people don't know how to import permission_classes
This commit is contained in:
parent
f7d44dfae0
commit
c099d9aac4
|
@ -88,6 +88,8 @@ 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 permission_classes
|
||||||
|
|
||||||
@api_view('GET')
|
@api_view('GET')
|
||||||
@permission_classes((IsAuthenticated, ))
|
@permission_classes((IsAuthenticated, ))
|
||||||
def example_view(request, format=None):
|
def example_view(request, format=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user