南0.8.3升级导致DeserializationError

时间:2013-11-19 03:22:33

标签: django django-south

我有一个使用South 0.8.2的Django 1.5.5项目。一切都很好 - 包括使用South的迁移。当我尝试将此项目升级到South 0.8.3时,运行python manage.py migrate时出现以下错误:

(VBEZ)vagrant@vagrant-ubuntu-precise-64:/vagrant$ python manage.py migrate
Running migrations for django_mailbox:
- Nothing to migrate.
 - Loading initial data for django_mailbox.
Installed 3 object(s) from 1 fixture(s)
Running migrations for djcelery:
- Nothing to migrate.
 - Loading initial data for djcelery.
DeserializationError: Problem installing fixture 'initial_data.json': Invalid model identifier: 'sites.site'

发生了什么事?

这是我的initial_data.json文件:

[
  {
    "pk": 1, 
    "model": "sites.site", 
    "fields": {
      "domain": "0.0.0.0:5000", 
      "name": "Project (Development)"
    }
  }, 
  {
    "pk": 2, 
    "model": "sites.site", 
    "fields": {
      "domain": "project-staging.example.com", 
      "name": "Project (Staging)"
    }
  }, 
  {
    "pk": 3, 
    "model": "sites.site", 
    "fields": {
      "domain": "project.example.com", 
      "name": "Project"
    }
  }
]

以下是使用South 0.8.2成功迁移的原因:

Running migrations for django_mailbox:
- Nothing to migrate.
 - Loading initial data for django_mailbox.
Installed 3 object(s) from 1 fixture(s)
Running migrations for djcelery:
- Nothing to migrate.
 - Loading initial data for djcelery.
Installed 3 object(s) from 1 fixture(s)
Running migrations for taggit:
- Nothing to migrate.
 - Loading initial data for taggit.
Installed 3 object(s) from 1 fixture(s)
Running migrations for eee_core:
- Nothing to migrate.
 - Loading initial data for eee_core.
Installed 3 object(s) from 1 fixture(s)
Running migrations for core:
- Nothing to migrate.
 - Loading initial data for core.
Installed 3 object(s) from 1 fixture(s)

我看过/试过的事情:

  • django-contrib-sites在我的`INSTALLED_APPS'
  • 如果删除initial_data.json文件,迁移工作正常。
  • 如果我单独运行迁移,它们运行正常。示例python manage.py migrate myapp
  • 我已提交了一张票:http://south.aeracode.org/ticket/1324

感谢。

1 个答案:

答案 0 :(得分:3)

看起来这是South 0.8.3中的一个已知错误:http://south.aeracode.org/ticket/1320。修复预计在一周左右。

更新:South 0.8.4解决了这个错误。