Django 1.7 makemigrations freezing/hanging

天涯浪子 提交于 2019-12-05 00:49:55

You should try disabling all of your installed_apps and seeing if that solves the problem. If it does, isolate the one causing the issues. Then set debugging traces.

Django 1.7 had this bug apparently that can cause migrations for a large enough number of models to freak out. They said they were doing something about this, and seems like they might have fixed it in 1.7.1.

https://docs.djangoproject.com/en/1.7/releases/1.7.1/

It's the third entry, and there's a few more improvements that may be connected to this.

Heard it first in this talk, hope it solves your problem: https://www.youtube.com/watch?v=bjIXZ-XX2SM

John Schmitt

Are there open connections to the database you're migrating? If so, that is probably the reason your migration hangs. See this south bug for more information. I realise that Django 1.7 does not use south and that bug refers specifically to south. Migrations are built directly in Django 1.7, but since other people have the same problem, I fear this issue is still around.

I had exactly the same issue, and as suggested in another answer i tried to eliminate applications in INSTALLED_APPS and then found my app which was causing this behavior.

Finally this line of code was the cause:

import fabric

when i removed it everything worked fine.

I noticed (following first django tutorial) that adding new field to the model class causes makemigrations to hang. Editing existing field, removing field, adding new model class - it all works, only adding new field to existing class hangs. Im not sure if this is also the case in 1.8 version.

Edit: this only happens in git bash under windows 7. when I try windows cmd console - it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!