I get django.db.utils.IntegrityError: UNIQUE constraint failed: auth_user.username for no apparent reason

ぐ巨炮叔叔 提交于 2019-12-02 17:11:16

问题


I have a very weird situation

when I create the superuser at first I get no problem,

then when I run

python manage.py shell

and type

>>> from django.contrib.auth.models import User
>>> User.objects.all()

I get the following

<QuerySet [<User: >]>

a superuser with no username , and when I try to create a second superuser(even with a different username) because this one obviously can't be used , I get the error in the title

what happened to my app ? or what was new ? .. I deleted my database file and migration files and made a makemigrations and migrate commands

to know more about why I did that check this problem

so how can I fix this ?

来源:https://stackoverflow.com/questions/58891301/i-get-django-db-utils-integrityerror-unique-constraint-failed-auth-user-userna

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!