简体   繁体   English

django.db.migrations.exceptions.NodeNotFoundError:运行“python manage.py migrate”时

[英]django.db.migrations.exceptions.NodeNotFoundError: upon running "python manage.py migrate"

I have just started a new django project, which is my own blog.我刚刚开始了一个新的 django 项目,这是我自己的博客。 I ran this command first:我先运行了这个命令:

django-admin startproject mysite

Then:然后:

python manage.py migrate

But, upon running python manage.py migrate , I am getting this error:但是,在运行python manage.py migrate ,我收到此错误:

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\commands\migrate.py", line 86, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
    self.build_graph()
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\loader.py", line 274, in build_graph
    raise exc
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\loader.py", line 248, in build_graph
    self.graph.validate_consistency()
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\graph.py", line 195, in validate_consistency
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\graph.py", line 195, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "C:\Users\Padma Jain\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\graph.py", line 58, in raise_error
    raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0012_user_following dependencies reference nonexistent parent node ('account', '0002_contact')

I haven't even written any code yet.我什至还没有写任何代码。 Then why am I getting this error?那为什么我会收到这个错误? Please help me out请帮帮我

It's probably corrupted file when installing django.安装django时可能是文件损坏了。 Try re-installing your django since that's django's migrations file that is missing.尝试重新安装 django,因为 django 的迁移文件丢失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 django.db.migrations.exceptions.NodeNotFoundError - django.db.migrations.exceptions.NodeNotFoundError Django 迁移 - django.db.migrations.exceptions.NodeNotFoundError - Django migrations - django.db.migrations.exceptions.NodeNotFoundError 删除迁移文件并获取 django.db.migrations.exceptions.NodeNotFoundError: - Deleting Migration Files and Getting django.db.migrations.exceptions.NodeNotFoundError: 在命令提示符下运行服务器时出现 django.db.migrations.exceptions.NodeNotFoundError - django.db.migrations.exceptions.NodeNotFoundError when running the server in command prompt 我的项目中没有名为“帐户”的应用程序,但 django 仍然抛出 django.db.migrations.exceptions.NodeNotFoundError - No app named 'account' in my project but django still throws django.db.migrations.exceptions.NodeNotFoundError django.db.migrations.exceptions.NodeNotFoundError:迁移accounts.0001_initial依赖项引用不存在的父节点 - django.db.migrations.exceptions.NodeNotFoundError: Migration accounts.0001_initial dependencies reference nonexistent parent node IBM Cloud db2 django 迁移 python manage.py migrate - IBM Cloud db2 django migrations python manage.py migrate python3 manage.py迁移异常 - python3 manage.py migrate exceptions 删除我的数据库并尝试应用新的迁移后,我收到了这个错误,说 django.db.migrations.exceptions.NodeNotFoundError - After deleting my database and trying to apply a new migrations i get this errors that say django.db.migrations.exceptions.NodeNotFoundError 自定义 django 数据迁移创建记录 allauth.account EmailAddress model 返回错误 - django.db.migrations.exceptions.NodeNotFoundError: - Custom django data migration creating records allauth.account EmailAddress model returns error - django.db.migrations.exceptions.NodeNotFoundError:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM