依赖引用在Django中不存在父节点错误 [英] dependencies reference nonexistent parent node error in Django

查看:64
本文介绍了依赖引用在Django中不存在父节点错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在使用 Django示例书来学习Django。

我进入了新的章节,在那里我需要创建一个新的项目和应用程序。这就是我所做的。

So, I am learning Django using Django By Example book.
I moved to a new chapter where I needed to make a new project and app. This is what I did.

django-admin startproject myshop

cd到myshop目录

cd to myshop directory

django-admin startapp shop
python manage.py migrate 

我无法迁移,但出现以下错误:

I am unable to migrate with the following error:


django.db.migrations.exceptions.NodeNotFoundError:迁移django.db.migrations.exceptions.NodeNotFoundError:迁移auth.0009_user_following依赖项引用不存在的父节点(u' account',u'0002_contact')

django.db.migrations.exceptions.NodeNotFoundError: Migration django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0009_user_following dependencies reference nonexistent parent node (u'account', u'0002_contact')

我确实在帐户中建立了 Contact 模型
新项目与旧项目有何关系?

I did make Contact model in account app in my last project.
How is the new project related to the old one?

请帮助我解决此问题。谢谢。

Please help me resolve this problem. Thanks.

推荐答案

这意味着您的中没有文件 0002_contact 。帐户应用的迁移文件夹。您需要恢复文件或配置文件 0009_user_following ,然后删除(u'account',u'0002_contact')

It means that you don't have the file 0002_contact in your account app's migration folder. You need to recover the file or configure this file 0009_user_following and remove the (u'account', u'0002_contact') line

这篇关于依赖引用在Django中不存在父节点错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆