1、在项目根目录下运行:python manage.py shell 2、重设密码 from django.contrib.auth.models import User user =User.objects.get(username='admin') user.set_password('new_password') user.save()