加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

django – 南0.8.3升级导致DeserializationError

发布时间:2020-12-16 21:33:08 所属栏目:Python 来源:网络整理
导读:我有一个使用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 migrateRunning
我有一个使用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,"fields": {
      "domain": "project-staging.example.com","name": "Project (Staging)"
    }
  },{
    "pk": 3,"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迁移myapp.
>我已经提交了一张票:http://south.aeracode.org/ticket/1324

谢谢.

解决方法

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

更新:South 0.8.4修复了这个bug.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读