Disable CSRF verification for Django REST API

If you are also sucked by CSRF Failed message in django rest,
then there is a professional way to disable the CSRF verification while using Django REST APIs. However if you want to know simply what csrf is check out my other post "csrf in Django".


{ "detail": "CSRF Failed: CSRF token missing or incorrect." }

Add following lines in your settings.py:



or if you have already these lines in your settings.py file, then find and remove following line from settings.py:

Leave a comment

Your email address will not be published.


Subscribe to Khalsa Labs