忘记管理员,使用Pycharm
使用其他方法,运行下面命令
python manage.py shell
>>> from django.contrib.auth.models import User
>>> user = User.objects.get(pk=1)
>>> user
<User: ************>
>>>
重设密码(如果用户也是刚找回的,第一条命令忽略。Pycharm中同样)
>>> from django.contrib.auth.models import User
>>> user = User.object.get(username='your_account')
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()