django create superuser failed

得到以上界面后自然希望能够登录进行操作,此时需要创建用户,但在执行python manage.py  createsuperuser 时报以下错误:

return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user

从报错提示可以看出是不存在对应的数据表,实际上是由于创建的模型没有迁移到数据库,此时只需要执行python manage.py makemigrations

django create superuser failed

接着执行python manage.py migrate

django create superuser failed

最后再执行python manage.py  createsuperuser 就可以了。

相关文章:

  • 2021-05-28
  • 2021-05-27
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-12-10
猜你喜欢
  • 2021-05-25
  • 2021-07-20
  • 2021-08-14
  • 2021-08-07
  • 2021-11-29
  • 2021-11-07
相关资源
相似解决方案