I am unable to log into an instance of a Django app under development as a SuperUser. I have changed password through ./manage.py changepassword
successfully. I have also changed password via the running instance of the app (it has password recovery all set up and functional).
Yet, on the login page, the authentication still fails. What could be the cause?
More …
I have tried creating a fresh superuser with ./manage.py createsuperuser
. The newly created account also fails to login the page. I did not tamper with the view. What is going on? How do I troubleshoot this?
Note:
I recently migrated from Django 5.1 to 5.2
Does auth fail with server side errors, or do you get a Permission Denied 403 or similar? If server error, is there any stack trace you can share?
Are you using Django’s built-in auth backend, or something 3rd party (allauth?) or custom?
Are you trying to log in at the Django admin or at your own login page? Can you log in at the Django admin and THEN visit your site?
1 Like
That worked. Thanks
So then the issue is with my login implementation. I am using allauth
. The only error message I get is from form.errors
(“password and username doesn't match
”). The view that is rendering is LoginView
as per:
from allauth.account.views import LoginView
Whereas, it is the failing password/user pair that worked for the admin page
Can a reset in migrations affect authtentication? Is it possible that resetting migrations can affect authenticcation?
I don’t think migrations would be an issue. Since you recently updated Django, did you check that your current version of allauth supports Django 5.2? Check the allauth changelog to see if there are any interesting notes.
1 Like
I decided to update allauth instead. It was at 65.3.x
After the update the following showed up:
System check identified some issues:
WARNINGS:
?: settings.ACCOUNT_EMAIL_REQUIRED is deprecated, use: settings.ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*']
?: settings.ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE is deprecated, use: settings.ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*']
?: settings.ACCOUNT_USERNAME_REQUIRED is deprecated, use: settings.ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*']
I also found out that my login dilemma showed up from version 65.5.x. Whereas, my update brought in 65.8.1
I now understand what messed up the login. I had updated a module that pulled in newer packages (except allauth). I have applied the recommended fixes as per the error message above.
The login is working again. Thank you very much
1 Like