migrate.py:未知命令:'migrate'

时间:2014-03-15 20:30:17

标签: python django

我使用的是django 1.3.7(Python 2.7),我希望将migrate命令与manage.py一起使用。 但我得到未知命令

[fuiba@web300 app]$ python2.7 manage.py migrate --settings=settings --fake
Unknown command: 'migrate'
Type 'manage.py help' for usage.

我在settings.py中将South添加到INSTALLED_APPS,在运行迁移之前,我导出了设置并运行了syncdb

[fuiba@web300 app]$ export DJANGO_SETTINGS_MODULE=settings
[fuiba@web300 app]$ python2.7 manage.py syncdb --settings=settings

同样在Python shell中,我得到没有名为migrate的模块

[fuiba@web300 app]$ python2.7
Python 2.7.5 (default, May 16 2013, 20:16:09) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import migrate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named migrate
>>>

可能是Python的问题,因为当我运行此命令以获取我正在运行的版本时,我得到''而不是路径:

[fuiba@web300 app]$ which python
alias python=''

感谢您的帮助!

0 个答案:

没有答案