Skip to content

Django 1.2.1 – CSRF verification failed – 403 Error

by admin on June 8th, 2010

Here is the kind of error you can get while attempting to make a POST request after migrating to Django 1.2.1:

403 Forbidden
CSRF verification failed. Request aborted.

Reason given for failure:
CSRF cookie not set.

To correct this, all you have to do is to add  ‘django.middleware.csrf.CsrfViewMiddleware’, and ‘django.middleware.csrf.CsrfResponseMiddleware’ to your MIDDLEWARE_CLASSES in your file.


From → Tips

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS