Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django admin login page redirects to same page on correct login credentials

I'm running a relatively fresh Django app that I haven't added much to. I tried to set up the admin (which I've done on plenty of other apps) to create some sample data while I build out the app, but whenever I try to log in with the super user account I created I get kicked back to the login screen.

When I enter incorrect credentials, I see the proper error message... I just can't get it to take me past the login screen to the admin when I have correct credentials. Has anyone else had this problem and been able to solve it? I'm at a dead end troubleshooting.

like image 737
gohnjanotis Avatar asked Aug 24 '11 14:08

gohnjanotis


3 Answers

Check that SESSION_COOKIE_SECURE is not set while you are not using HTTPS.

like image 101
webjunkie Avatar answered Nov 17 '22 09:11

webjunkie


Looks like your cookies are messed up. Please start with clearing cookies in browser. If it doesn't help you can also check if your cookies configuration for project is correct. List of settings for cookies configuration can be found here.

like image 26
dzida Avatar answered Nov 17 '22 07:11

dzida


Use the below settings for the SESSION_COOKIE_DOMAIN:

SESSION_COOKIE_DOMAIN = "yourdomain.com"
like image 1
Shariq Avatar answered Nov 17 '22 07:11

Shariq