Django South:模型更改的计划挂起

2024-05-01 12:40:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在跟踪South tutorial。我能够成功地完成“第一次迁移”下的步骤。然而,当格雷蒂恩再次运行模式时:

python manage.py schemamigration southtut --auto

命令从未完成。我没有收到任何错误消息。以下是我在南方教程中对模型所做的修改:

^{pr2}$

以下是初始迁移的日志:

$ python manage.py schemamigration southtut --initial
Creating migrations directory at 'c:\Users\jp\Documents\project\southtut\migrations'...
Creating __init__.py in 'c:\Users\jp\Documents\project\southtut\migrations'...
 + Added model southtut.Knight
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate southtut
(django-test)
jp@jp-PC ~/project
$
(django-test)
jp@jp-PC ~/project
$ python manage.py migrate southtut
Running migrations for southtut:
 - Migrating forwards to 0001_initial.
 > southtut:0001_initial
 - Loading initial data for southtut.
Installed 0 object(s) from 0 fixture(s)

这是最新消息。在

我正在使用msys。我注意到当我输入python(没有任何参数)时,它也挂起了。当我使用cmd时,运行python没有挂起。当我在cmd中执行python manage.py schemamigration southtut --auto操作时,命令完成了。不过,我不得不安装virtualenvwrapper-win,因为我使用的是virtualenvwrapper。有人知道为什么用--auto运行schememigration会挂在msys上吗?或者说,为什么运行python会挂起?我可以运行startappsyncdbrunserver而没有问题。我宁愿不使用cmd。在

另一个更新: 这肯定与python不能交互的问题有关。我把msys安装在装有windows7的PC机上,可以毫无问题地运行python格式的msys。有问题的电脑是Vista,我的家用电脑。这肯定是以前用过的。即使卸载并重新安装msys,问题仍然会发生。我认为OpenSSH for Windows可能导致了这个问题,因为它破坏了我的路径。在

但是python -i工作得很好。如果我这样做,python -i manage.py schemamigration southtut --auto迁移文件就被创建了,但是最后我得到python提示。我想我可以接受这个,但这肯定是以前的工作,这让我发疯。在


Tags: py命令creatingprojectcmdforautomanage