First time here? Check out the FAQ!

fail to create an account on development server

I am following this to start a new forum. But I can not create a new account. When I press 'Create Account' it says

Forbidden (403) CSRF verification failed. Request aborted.

Reason given for failure:CSRF cookie not set.

I found this entry but suggested lines were already in my What am I missing?

PS: The error page also comes when I try to click google or yahoo to log in.

kabexnuf's avatar
updated 2011-07-29 07:59:37 -0500, asked 2011-07-29 02:55:31 -0500
edit flag offensive 0 remove flag close merge delete


Hello, did you use "startforum" to set up your file? Or you made one by hand?
Evgeny's avatar Evgeny (2011-07-29 07:52:47 -0500) edit
add a comment see more comments

1 Answer


If you have set up CSRF_COOKIE_DOMAIN as in this answer and the domain name matches your site's domain, and the csrf middleware is installed, then everything should work. Please double-check the details in that answer carefully.

In the case you have everything set up correctly, but the login still does not work, please email me zipped version of your project ( or a link where I can download the file, if possible with information about version of Django you are using. Then I will test it out.


Evgeny's avatar
answered 2011-07-29 07:59:07 -0500
edit flag offensive 0 remove flag delete link


Thanks, i did not know that domain names should match. I wrote just something else in I changed it to localhost and problem solved.
kabexnuf's avatar kabexnuf (2011-07-29 08:07:31 -0500) edit
Very good, the purpose of CSRF - cross site request forgery protection is to prevent someone from posting anything to your account from another fake site, while you are logged in to a real site. Not a huge deal for a forum, but csrf protection is a standard security measure.
Evgeny's avatar Evgeny (2011-07-29 08:18:04 -0500) edit

I had this problem too, because says to run: python runserver hostname -i:8000 but the IP address doesn't match the CSRF setting domain in

Joseph's avatar Joseph (2011-11-15 17:09:10 -0500) edit
add a comment see more comments