Django 1.9 - makemigrations - 没有检测到变化 [英] Django 1.9 - makemigrations - No changes detected

查看:614
本文介绍了Django 1.9 - makemigrations - 没有检测到变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



通常使用<$ c创建新应用程序时,使用现有的应用程序,我尝试使用makemigrations命令创建迁移$ c> startapp 命令,但这个特定的应用程序不是。



在进行调试后,我发现它不是创建迁移,因为迁移应用程序中缺少包/文件夹。



如果它不在那里,它会创建文件夹,或者可能我缺少某些东西

解决方案

要为应用程序创建初始迁移,请运行 makemigrations 并指定应用程序名称。迁移文件夹将被创建。

  ./ manage.py makemigrations< myapp> 

您的应用程序必须包含在 INSTALLED_APPS 中。


With an existing app I was trying to create migrations, using makemigrations command but it says "No changes detected".

Usually I create new apps using startapp command but this particular app was not.

After a while doing debugging, I found that it is not creating migration because migrations package/folder is missing from an app.

Will be better it creates folder if it is not there or maybe I am missing something

解决方案

To create initial migrations for an app, run makemigrations and specify the app name. The migrations folder will be created.

./manage.py makemigrations <myapp>

Your app must be included in INSTALLED_APPS first.

这篇关于Django 1.9 - makemigrations - 没有检测到变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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