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

created at 12-29-2021 views: 2

error message

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

Here is the solution

  • Step 1: Uninstall Django, pip uninstall Django
  • Step 2: At this point there is still a residual Django folder in the /Lib/site-packages, delete it
  • Step 3: Delete all pycache folders in the project, delete files under migrations and keep init .py.
  • Step 4: Reinstall the corresponding version of Django, otherwise some will be incompatible,
  • Step 5: make migrations, and then you will success!
Please log in to leave a comment.