【问题标题】:django.db.migrations.exceptions.NodeNotFoundError Migration authentication nonexistent parent nodedjango.db.migrations.exceptions.NodeNotFoundError 迁移认证不存在父节点
【发布时间】:2018-08-26 22:03:36
【问题描述】:

我在 django 上运行我的代码时遇到了这个问题。可能是什么问题?我正在使用 django 2.0.2

  Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f6ead6dcea0>
Traceback (most recent call last):
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 128, in inner_run
    self.check_migrations()
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/core/management/base.py", line 422, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/loader.py", line 274, in build_graph
    raise exc
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/loader.py", line 244, in build_graph
    self.graph.validate_consistency()
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/graph.py", line 261, in validate_consistency
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/graph.py", line 261, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/home/geek/PycharmProjects/hadhari/venv/lib/python3.6/site-packages/django/db/migrations/graph.py", line 104, in raise_error
    raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration authentication.0001_initial dependencies reference nonexistent parent node ('auth', '0009_alter_user_last_name_max_length')

【问题讨论】:

    标签: django django-models


    【解决方案1】:

    我已经找到了问题所在。我确实进入了django/django/contrib/auth/migrations/ 并意识到迁移文件丢失了。

    由此,我意识到我必须卸载 django 并重新安装 它,你将不再得到错误。

    【讨论】:

      猜你喜欢
      • 2021-04-20
      • 2018-11-27
      • 2017-10-26
      • 1970-01-01
      • 2020-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多