tags:

views:

270

answers:

3

I have just upgraded to Django 1.2 and I am trying to run my project. After I login I get

Forbidden (403)
CSRF verification failed. Request aborted.

which is strange because I haven't enabled CSRF protection previously. Do I have to configure something else to have my project work?

A: 

http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#upgrading-notes

Daniel Roseman
I have read this doc first :-) `If you do not have any of the middleware in your MIDDLEWARE_CLASSES, you will have a working installation but without any CSRF protection for your views (just as you had before).` I don't have any middleware enabled, but I get 403 anyway.
gruszczy
+1  A: 

It seems, that CSRF protection is on for contrib.admin views, which I use for login. This is why I get 403.

gruszczy
+2  A: 

Yep, that's because you use contrib.admin view for login with a custom template. You should add csrf_token to your login template.

DataGreed