gpt4 book ai didi

django - 南0.8.3升级导致DeserializationError

转载 作者:行者123 更新时间:2023-12-03 21:18:46 25 4
gpt4 key购买 nike

我有一个使用 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

  • 谢谢。

    最佳答案

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

    更新 :South 0.8.4 修复了这个错误。

    关于django - 南0.8.3升级导致DeserializationError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20062522/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com