"detail": "CSRF Failed: CSRF token missing or incorrect."
I'm making RESTful API using Tastypie, and when I try to POST/PUT/DELETE a request it says: "detail": "CSRF Failed: CSRF token missing or incorrect.". It works fine with GET. I've read various threads on SO, saying: to delete the cookies or use @csrf_exempt or use @method_decorator(csrf_exempt) but neither of it worked. How can I over-pass this error? views.py class SnippetList(mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView): queryset = Snippet.objects.all() serializer_class = SnippetSerializer def get(self, request, *args, **kwargs): return self.list(request, *args, *
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.