Skip to content

Instantly share code, notes, and snippets.

@jramnani
Created July 1, 2016 21:57
Show Gist options
  • Save jramnani/d00798d346d796d2ceaf3645f4f2f231 to your computer and use it in GitHub Desktop.
Save jramnani/d00798d346d796d2ceaf3645f4f2f231 to your computer and use it in GitHub Desktop.
# The code:
class MyView(APIView):
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated,)
@csrf.csrf_exempt
def get(self, request):
return Response({}, status=200)
@csrf.csrf_exempt
@authentication_classes([])
@permission_classes([])
def post(self, request):
"""Create a new user."""
return Response({}, status=201)
# Error Message
File "/path/to/app/tests/api/test_views.py", line 241, in <module>
class MyView(APIView):
File "/path/to/app/tests/api/views.py", line 256, in MyView
@authentication_classes([])
TypeError: 'tuple' object is not callable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment