[Fixed]-Django – Mysql Integrity error 1048, "Column 'id_fleet_id' cannot be null"

1👍

Maybe this error raised because you migrate your models when the id_fleet_id field null parameter was False or not set, then later you change value of null parameter to True but this decision not applied to database, run below commands:

python manage.py makemigrations

And then run:

python manage.py migrate

Also you can change nullable check in database, open your project database and then open your_app_name_track table for edit and check nullable of id_fleet_id field.

Leave a comment