1

我在尝试使用 postgres 将带有 sqlite3 后端的本地开发 django cms 中的内容迁移到 AWS 时遇到问题。我正在使用以下命令转储所有页面数据、标题、插件以及大概的文件管理器图像

manage.py dumpdata --indent=4 --natural-foreign --exclude cms.pageuser cms filer aldryn_bootstrap3 djangocms_column cmsplugin_filer_image cmsplugin_filer_file djangocms_googlemap djangocms_link djangocms_style djangocms_text_ckeditor > all_content.json

但是,当我尝试在暂存环境中运行 loaddata 时,我收到外键完整性错误 - 特别是在表 filer_file 周围。查看表结构,对于我在 filer_image 中的每个图像,我应该在 filer_file 中有一个外键引用——它不反映 JSON 转储文件中的内容。

奇怪的是,对于文档(例如 pdf),dumpdata 命令可以正常工作,它只与图像有关。此外,如果我手动生成丢失的 json 数据,它就可以正常工作。

有没有人遇到过这个问题?我刚刚升级到以下版本,仍然看到错误。

aldryn-bootstrap3==1.0.10
cmsplugin-filer==1.1.2
colorama==0.3.3
dj-database-url==0.4.1
Django==1.9.7
django-appconf==1.0.2
django-bootstrap3==7.0.1
django-classy-tags==0.7.2
django-cms==3.3.0
django-debug-toolbar==1.4
django-durationfield==0.5.2
django-extensions==1.6.7
django-filer==1.2.4
django-fixture-magic==0.0.8
django-formtools==1.0
django-mail-templated==2.6.2
django-mptt==0.8.4
django-polymorphic==0.8.1
django-reversion==1.10.0
django-sekizai==0.9.0
Django-Select2==4.3.2
django-storages==1.4.1
django-treebeard==4.0.1
django-widget-tweaks==1.4.1
djangocms-admin-style==1.2.3
djangocms-attributes-field==0.1.0
djangocms-column==1.6.0
djangocms-googlemap==0.4.0
djangocms-inherit==0.2.1
djangocms-installer==0.8.8
djangocms-link==1.7.2
djangocms-style==1.7.0
djangocms-text-ckeditor==2.9.3
docutils==0.12
easy-thumbnails==2.3
html5lib==0.9999999
jmespath==0.9.0
Pillow==3.3.0
psycopg2==2.6.1
pyasn1==0.1.9
python-dateutil==2.5.3
pytz==2016.4
rsa==3.4.2
s3transfer==0.0.1
six==1.10.0
sqlparse==0.1.19
tzlocal==1.2.2
Unidecode==0.4.19
4

1 回答 1

1

这是一种解决方法,而不是完全的答案。我相信问题出在多态/过滤器灰色区域的某个地方。编写自己的序列化程序来模仿 dumpdata 的作用,解决了我的问题。

无论如何都记录了一个错误请求。

https://github.com/divio/django-filer/issues/887

于 2016-07-13T00:08:45.547 回答