Django如何重设Admin密码
django设置用户是python manage.py createsuperuser,但是如果忘记密码,那么应该进入shell环境 下修改
python manage.py shell
from
django.contrib.auth.models
import
User
user
=
User.objects.get(username
=
'admin'
)
user.set_password(
'new_password'
)
user.save()