进入项目路径:

python manage.py createsuperuser
按照提示输入相应的用户名,邮箱和密码即可

 

Django忘记管理密码,重设管理员密码

进入项目路径:

from django.contrib.auth.models import User 
user = User.objects.get(username='root') # root为后台登录的用户名
user.set_password('abc123') #将root密码设置为abc123
user.save()

Django创建超级管理员

相关文章:

猜你喜欢
相关资源
相似解决方案