1.执行shell命令
2.先输入:from django.contrib.auth.models import User
然后是:user=User.objects.create_superuser('name','emailname@demon.com','password')
三个参数依次为用户名,邮箱,密码
本文介绍如何通过Python shell命令在Django中创建一个超级用户,包括执行shell命令的方法及具体的Python代码实现。
1.执行shell命令
2.先输入:from django.contrib.auth.models import User
然后是:user=User.objects.create_superuser('name','emailname@demon.com','password')
三个参数依次为用户名,邮箱,密码
539
1686

被折叠的 条评论
为什么被折叠?