Answer the question
In order to leave comments, you need to log in
How to disable csrf validation when requesting an API from a mobile application in Django?
There is an API to the backend, a mobile application connects to the API.
When logging in I get:
{
"detail": "CSRF Failed: CSRF cookie not set."
}
Answer the question
In order to leave comments, you need to log in
For ordinary views, there is such a decorator:
And for class based views, it can be wrapped using method_decorator (apply to the dispatcher) or using the CsrfExemptMixin mixin, ( https://github.com/brack3t/django-braces)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question