简体   繁体   English

终端卡在 python manage.py makemigrations 和 runserver

[英]Terminal is stuck on python manage.py makemigrations and runserver

I am using Pycharm for django development, after adding some models to the models.py the terminal is stuck at python manage.py makemigrations command, runserver doesn't work also.我正在使用 Pycharm 进行 django 开发,在将一些模型添加到 models.py 后,终端卡在 python manage.py makemigrations 命令,runserver 也不起作用。

The terminal is freezing.终端结冰。

It was working perfectly, it did not work after the modification in models.py, I tried to delete the migration files but it didn't work, restart the computer didn't help.它工作正常,在models.py中修改后它没有工作,我试图删除迁移文件但它没有工作,重新启动计算机没有帮助。 Look at the pictures please.请看图片。

Any ideas?有任何想法吗?

Thanks a lot非常感谢

makemigrations runserver makemigrations 运行服务器

The same situation happened to me and I looked deeper at the models I had changed.同样的情况也发生在我身上,我更深入地研究了我改变的模型。

I just commented the fields i didn't want anymore, not removed, that was the problem.我只是评论了我不再想要的字段,没有删除,这就是问题所在。 Try removing.尝试删除。

Maybe the command "python manage.py makemigrations" already ran and you just need to do a "python manage.py migrate".也许命令“python manage.py makemigrations”已经运行,您只需要执行“python manage.py migrate”。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM