django.db.migrations.exceptions.NodeNotFoundError迁移认证不存在的父节点 [英] django.db.migrations.exceptions.NodeNotFoundError Migration authentication nonexistent parent node
本文介绍了django.db.migrations.exceptions.NodeNotFoundError迁移认证不存在的父节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在django上运行我的代码,遇到了这个问题.可能是什么问题?我正在使用Django 2.0.2
I was running my code on django and i ran into this problem. What might be the issue? I am using 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/contrib/auth/migrations/
并意识到缺少迁移文件.
I have figured out the problem. I did go into django/django/contrib/auth/migrations/
and realized that the migration files were missing.
由此,我意识到我必须卸载django并再次重新安装它,并且该问题将消失,因为现在可以进行迁移了.
From this I realized that I had to uninstall django and re-installed it again and the problem will go away since the migration is now available.
这篇关于django.db.migrations.exceptions.NodeNotFoundError迁移认证不存在的父节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文