If you forget to set the Django Admin password, you can use theCreatesuperuserto even the password, but if you forget the admin password, then you need to use the Django Shell:
Python manage.py Shell
If this time error:
Python:can ' t open file ' manage.py ': [Errno 2] No such file or directory
You set the environment variable, but it is an error, why?
I looked for a long time and finally found the answer here: https://www.pythonanywhere.com/forums/topic/756/, that means, You want the CD to be underneath your project (you should have a manage.py file below your project) and then run: Python manage.py shell
then get your user name and reset the password:
From django.contrib.auth.models Import User user = User.objects.get (username= ' admin ') User.set_password (' New_password ') User.save ()
Then you can log in with the new password.
How Django Resets the admin password