I have a simple Django webhook that keeps returning a 403 forbidden
despite I have marked it with csrf_exempt
.
Here is the relevant code:
urls.py
...
url(r'^mail/$', MailView.as_view(), name="mail"),
...
view.py
class MailView(View):
@csrf_exempt
def dispatch(self, *args, **kwargs):
return super(MailTrackingView, self).dispatch(*args, **kwargs)
def post(self, request, *args, **kwargs):
return HttpResponse(status=204)
When sending data to this endpoint, Django gives a
Forbidden (CSRF cookie not set.): /mail/
What else do I have to set so the CSRF validation is not performed?