I get django.db.utils.IntegrityError: UNIQUE const

2020-04-30 18:14发布

问题:

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 ?