django版本1.11

>>> from django.contrib.auth.models import User
>>> user = User.objects.get(username='your account')
>>> user.set_password('your password')
>>> user.save()
>>> quit()

 

 

如果你连管理员用户名都忘了:

>>> from django.contrib.auth.models import User
>>> user = User.objects.get(pk=1)
>>> user
<User: you_account>
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()