Khalsa Labs
csrf error django

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.


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

Add following lines in your



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


to suppress csrf verification error forcefully you can refer this post

The following two tabs change content below.
Python Developer and DIY lover.

want to comment ??

Your email address will not be published. Required fields are marked *