Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django login not working

I have a really weird issue here. I'm using my local development server right now, and I'm working on the user account aspect of my site.

I thought I had it worked out, but when I try to access @login_required views I fill in the login information, and am redirected back to the login page everytime. When I try to login to the admin site (to verify everything is good on the backend) the same thing happens: I put in a correct username and password, and am redirected back to the login page.

I verified via the shell that the username I'm using for the admin site is a super user, is staff, and is active. In my settings I have Authentication and Session middleware enabled, as well as django.contrib.auth and django.contrib.sessions in my installed apps. Any ideas? Thanks in advance!

like image 267
Smerk Avatar asked Oct 24 '25 01:10

Smerk


1 Answers

I got it-- I had set SESSION_COOKIE_SECURE to True in my settings.py, but since I'm using the development server SSL isn't enabled it would just redirect to the same page. Thanks for the help guys you got me searching around.

like image 70
Smerk Avatar answered Oct 26 '25 14:10

Smerk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!