1、忘记密码:
>>> from django.contrib.auth.models import User
>>> user = User.object.get(username='your_account')
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()
2、忘记账号:
>>> from django.contrib.auth.models import User
>>> user = User.object.get(pk=1)
>>> user
<User: you_account>
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()
3、新建管理员账号:
python manage.py createsuperuser
Username (leave blank to use 'administrator'): user01
Email address: (在这里输入你的自己的邮箱帐号)
Password:
Password (again):