用Django安装South的问题(south_migrationhistory表不会被创建) [英] Problems installing South with Django (south_migrationhistory tables do not get created)

查看:348
本文介绍了用Django安装South的问题(south_migrationhistory表不会被创建)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法正常工作。



我需要南方为一堆应用程序进行迁移。


  1. 下载0.7.3

  2. 解压缩,运行setup.py开发tur orial))b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b))))))))))))))))))))) $ b


    import south



  3. 我做





  C:\Users\j\iMiCode\imi_admin> python ./manage.py syncdb 

同步...找不到灯具。

 同步:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> django.contrib.admin

未同步(使用迁移):
- 南(使用./manage.py迁移迁移这些)
/ pre>

这一点从我所了解的南方应该是同步正确吗?
此后我还做了一些事情,抱怨说我在数据库中没有south_migrationhistory表。



PS。我正在与Django 1.2.7,python 2.6,在Windows7上

解决方案

在我看来,像南方的一个错误。 / p>

另外这可能是由于执行错误的假设,如:运行 schemamigration --auto south 等等。我的建议将通过运行 python setup.py install 或通过 easy_install pip


进行安装南方文档说:一旦添加了South,您需要运行./manage.py syncdb来制作South迁移跟踪表(South不会为自己的模型使用迁移,因为各种原因)



但是您的输出表示,南部跳过了自己的模型表,因为它认为南方应用程序使用迁移



作为一种解决方法,您可以使用

  python manage.py syncdb --all 

哪些导致所有表,而不考虑迁移进行同步,

  python manage.py migrate --fake 

伪造迁移。


I cannot seem to get this working.

I need South to do migrations for a bunch of apps.

  1. Downloaded south 0.7.3
  2. Unzipped, ran setup.py develop (as it says in the turorial)
  3. Double checked to see if it south is where it should be by going to python interpreter and doing (no errors)

    import south

  4. I do

C:\Users\j\iMiCode\imi_admin>python ./manage.py syncdb

Syncing... No fixtures found.

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.admin

Not synced (use migrations): 
 - south (use ./manage.py migrate to migrate these)

-At this point from what I understand south should have been synced correct? Anything else I do after this, complains that I have no south_migrationhistory tables in the database.

PS. I am working with Django 1.2.7, python 2.6, on Windows7

解决方案

It seems to me like a bug in South.

Also this may be cause by doing wrong thigs like: running schemamigration --auto south and etc. My suggestion would be install it by running python setup.py install or through easy_install or pip

South documentation says: "Once South is added in, you’ll need to run ./manage.py syncdb to make the South migration-tracking tables (South doesn’t use migrations for its own models, for various reasons)."

But your output says that south skipped making tables for its own models because it thought south app used migrations

As a workaround you could use

python manage.py syncdb --all

Which causes all tables regardless of migrations to be synchronized and

python manage.py migrate --fake 

to fake migrations.

这篇关于用Django安装South的问题(south_migrationhistory表不会被创建)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆