Django 1.7.3 - Lookup failed for model referenced by field

It happens when you change the target objects in relationship. Even if they have the same name and fields they are not the same objects. I had the same issue and deleting all previous migrations from migrations folder solved it.


You can also add as a dependency to the migration the last migration from the object's app. That did the trick for me.

class Migration(migrations.Migration):

dependencies = [
    (<app>, <last_migration_filename>),
...