Forums

Cannot access Admin account

I've not used PythonAnywhere for a while (because of a new baby rather than any problem with PythonAnywhere!) and come back to find I have no access to Database admin on any of my databases. I've changed my main account password and database password to no avail. I tried deleting one of the databases and rebuilding it, which I did successfully but when I try to log into Admin I get these messages:

"Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive."

"You are authenticated as [redacted], but are not authorized to access this page. Would you like to login to a different account?"

[redacted] is my main username. I'm a bit lost as to how to regain access to my admin?

First of all, congrats for the new baby! Regarding the issues -- I understand that the errors you see are produced by your web app, right? Maybe check the docs of the framework you use for how to reset the "admin" account (I don't think your PA account credentials or db password would be relevant here).

Thanks!

I got there in the end. I hadn't re-created a superuser after I dropped the databases and migrated them again. So it was solved by typing the following into the bash console:

cd [webapp*] python manage.py createsuperuser

*The folder containing manage.py.

I then entered a username, e-mail address and password for the superuser. Hey presto, it all worked perfectly again.

Great! Glad you got that working!