First time here? Check out the FAQ!
0

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 settings.py. What am I missing?

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

kabexnuf's avatar
3
kabexnuf
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

Comments

Hello, did you use "startforum" to set up your settings.py 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

0

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 (evgeny.fadeev@gmail.com) 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.

Thanks.

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

Comments

Thanks, i did not know that domain names should match. I wrote just something else in settings.py. 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 http://askbot.org/doc/initialize-database-tables.html says to run: python manage.py runserver hostname -i:8000 but the IP address doesn't match the CSRF setting domain in settings.py

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