Reputation:
The default permissions requires token authentication. I have a function based view that has the api_view
decorator. How can I explicitly set its permissions to not require authentication and csrf exempt?
@api_view(['GET'])
def activate(request, uidb64, token):
....
Upvotes: 3
Views: 1926
Reputation: 7330
You can use the permission_classes decorator like this:
@api_view(['GET'])
@permission_classes((IsAuthenticated, ))
def activate(request, uidb64, token):
....
Upvotes: 8