When I opened Django for the first time in a while, I forgot my superuser username and password, so This is a memorandum of how to check by hitting the command.
Launch a python command.
python
>>>from django.contrib.auth.models import User
>>>users = User.objects.all()
>>>user = users[0]
>>>user
<User:Forgotten username>
>>>user.set_password('Please set your favorite password')
>>>user.save()
Now that you can set a new password, You can now log in from the management screen.
Recommended Posts