[Django]-Django 2.1 NOT NULL Constraint Failed When Creating Super User

5👍

I just realized this message was buried in the dozens of lines of error messages:

You have 12 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate’ to apply them.

Running just manage.py migrate and/or manage.py migrate appname did not apply the required system migrations. I had to do each one individually this time for some reason.

After running each one individually I was able to create a superuser without a problem:

manage.py migrate admin
manage.py migrate auth
manage.py migrate contenttypes
manage.py migrate sessions

I’ve never had to do that before, however. If anyone knows a reason as to why that happened I’d love to know but I’ve solved the main issue for now.

0👍

I’m too used

manage.py migrate admin
manage.py migrate auth
manage.py migrate contenttypes
manage.py migrate sessions

this helped for me
python manage.py createsuperuser

Leave a comment