django.db.utils.IntegrityError: (1048, Column last_login cannot be null)

落日映苍穹つ 2023-02-20 08:15 117阅读 0赞

django创建超级用户 python manage.py createsuperuser,出现出现报错

error content

  1. django.db.utils.IntegrityError: (1048, "Column 'last_login' cannot be null")

大概意思就是因为是没有登陆过,所以就没有用户的存在

通过网上查找,发现重新对auth进行一次迁移

  1. python manage.py migrate auth

其实报错主要是因为我之前对模型迁移的时候是对指定的模型迁移的,并没有对所有的模型迁移,所以才会出现了个这样的错误

发表评论

表情:
评论列表 (有 0 条评论,117人围观)

还没有评论,来说两句吧...

相关阅读