我正在尝试向现有的Django应用程序添加South支持。在
我所做的:
pip install south
Add 'south' to INSTALLED_APPS in settings.py
Test that South is now there:
$ python manage.py shell
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import south
>>>
Also, check that South shows up in manage.py help:
python manage.py help
python manage.py syncdb
Make south manage your models:
python manage.py convert_to_south CaseReport
On other instances:
manage.py migrate app_name 0001 --fake
Make your model changes in models.py
Check what -would- happen (dry run):
python manage.py schemamigration CaseReport --auto --stdout
Run it for real:
python manage.py schemamigration CaseReport --auto
Finally:
python manage.py migrate CaseReport
...but this is tracebacking for me. :(
我得到的回溯是:
^{pr2}$有人知道我做错了什么吗?在
我使用的是django1.6和minicondacpython 2.7.5、south0.8.4和MySQL 5.5.37-0ubuntu0.13.10.1。在
谢谢!在
我也遇到了同样的问题,花了好几个小时应用不同的解决方案。问题是MySQL用户可能没有操作表的权限,或者数据库中存在回滚测试表。我两个都有,所以也许这会对某些人有所帮助:
授予用户对数据库所需的权限,然后刷新权限以使其生效:
删除表回滚测试(如果有):
^{pr2}$然后移民顺利进行。在
相关问题 更多 >
编程相关推荐