After a while, you find that you cannot even remember your password.
Normally, to reset in django, we use the
manage.py shell
utility where we import the User models and use set_password()
to reset the password. Well, there is an easier way.
- use the django
manage.py createsuperuser
utility to create a new superuser account - log in the Admin panel with the newly created account
- go to the Users models http://localhost:8000/admin/auth/user/ and select the previous user
- in the users' account details, use the "change password form" to create anew password for them
- you can now log out and log in with the new password. You can keep or delete the second superuser account
No comments:
Post a Comment