You are trying to add a non-nullable field ‘new_field’ to userprofile without a default

If you are in early development cycle and don’t care about your current database data you can just remove it and then migrate. But first you need to clean migrations dir and remove its rows from table (django_migrations)

rm  your_app/migrations/* 

Note: Don’t delete _ _ init _ _ .py in the migrations folder.

rm db.sqlite3
python manage.py makemigrations
python manage.py migrate

If you previously created a superuser for Django’s Admin web app then you might need to create the user again.

Leave a Comment