I\'m going to deploy my django application on DigitalOcean. Everything gone well, except following error, and my question is: where can I find source of this error, actually in
Just to share the solution that worked with my similar error that been received: In my case, this same error was received because I was creating the model instant with the fields values directly, without specifying the field name, so always the ID was taking the first one as default (ID=field1). The problem solved by adding the attributes name as well to the Instant creation.
Was:
model_instant = YourModel(field1, field2,...etc)
Solved by:
model_instant = YourModel(field1 = field1, field2 = field2,...etc)
Do this then follow what been recommended above of 1) deleting the dB file, and 2) delete the migrations then 3) do the makemigrations your_app_name then 4) migrations, then 5) run the server and you should be good to go.