Django migration error: has no field named u'DO_NOTHING'
When you added the migration with on_delete='DO_NOTHING' django generated a migration. Then, you generated a new migration with on_delete=models.DO_NOTHING. So you have to delete both migrations located in your_project/your_app/migrations/ and then execute makemigrations again.
Hope it helps!
I've been trying to add a foreign key to my models in Django 1.9 with the option on_delete='DO_NOTHING' per instructions on Django Docs, but for version 1.10. I ran python manage.py makemigrations without any problems but when I tried to run python manage.py migrate of course I got the error:
django.core.exceptions.FieldDoesNotExist: Entrance has no field named u'DO_NOTHING'
Realizing my mistake, I changed the option to on_delete=models.DO_NOTHING and ran makemigrations and migrate again but I'm still getting the same error:
django.core.exceptions.FieldDoesNotExist: Entrance has no field named u'DO_NOTHING'
Looks like something is wrong in migration files. Not too familiar with internal workings of Django so I don't know where to look to fix this. Any ideas?