Tag Archives: self.key

[Solved] NodeNotFoundError(self.error_message, self.key, origin=self.origin) django.db.migrations.excep

Error code:

raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration jobs.0001_initial dependencies reference nonexistent parent node ('auth', '0012_alter_user_first_name_max_length')

Solution:

The first step is to uninstall Django, PIP uninstall Django
the second step is to delete the remaining Django folder in the/lib/site packages package
the third step is to delete all pycache folders in the project, delete files under migrations, and retain init py.
Step 3: reinstall the corresponding version of Django, otherwise some will be incompatible.
Step 4: execute the migration. Success