Disable CSRF Verification in Django Class-Based View with csrf_exempt

While working on a Django web app, I had to disable CSRF protection in a view. The goal was that our API was accepting data from another part of our website and we needed to skip the CSRF protection just for that one page.

There are two great answers on how to do this on StackOverflow.

And nice documentation for Django Rest Framework on disabling CSRF for AJAX calls.

Comments are Closed