Search code examples
pythondjangodjango-cms

Django CMS:: Deserialization Error :: page has no field named 'path'


I have a Django application which is using Django CMS. I had built custom plugins, pages, users etc. in the application using CMS. I want to export the CMS data from my application to another instance of the same application which doesn't have any cms related data.

I am using the following command:

python manage.py dumpdata cms djangocms_column djangocms_file djangocms_googlemap djangocms_link djangocms_picture djangocms_style  djangocms_text_ckeditor djangocms_video > cms_export.json --indent=2

I copied that file to the other app instance and tried to load it using the following command:

python manage.py loaddata cms_export.json

I got the following error:

django.core.serializers.base.DeserializationError: Problem installing fixture '/cms_export.json': Page has no field named 'path'

cms_export.json snippet:

    [{
  "model": "cms.usersettings",
  "pk": 1,
  "fields": {
    "user": 2,
    "language": "en",
    "clipboard": 1
  }
},
{
  "model": "cms.usersettings",
  "pk": 2,
  "fields": {
    "user": 1,
    "language": "en",
    "clipboard": 7
  }
},
{
  "model": "cms.page",
  "pk": 4,
  "fields": {
    "path": "0004",
    "depth": 1,
    "numchild": 0,
    "created_by": "script",
    "changed_by": "xxxx",
    "parent": null,
    "creation_date": "2018-01-27T18:51:08.122Z",
    "changed_date": "2018-02-04T19:48:21.804Z",
    "publication_date": "2018-01-27T18:52:43.340Z",
    "publication_end_date": null,
    "in_navigation": true,
    "soft_root": false,
    "reverse_id": null,
    "navigation_extenders": null,
    "template": "base.html",
    "site": 1,
    "login_required": false,
    "limit_visibility_in_menu": null,
    "is_home": true,
    "application_urls": "",
    "application_namespace": null,
    "publisher_is_draft": true,
    "publisher_public": 5,
    "languages": "en",
    "revision_id": 0,
    "xframe_options": 0,
    "placeholders": [
      3,
      9
    ]
  }
},
{
  "model": "cms.page",
  "pk": 5,
  "fields": {
    "path": "0005",
    "depth": 1,
    "numchild": 0,
    "created_by": "admin",
    "changed_by": "xxxx",
    "parent": null,
    "creation_date": "2018-01-27T18:52:43.345Z",
    "changed_date": "2018-02-04T19:48:21.792Z",
    "publication_date": "2018-01-27T18:52:43.340Z",
    "publication_end_date": null,
    "in_navigation": true,
    "soft_root": false,
    "reverse_id": null,
    "navigation_extenders": null,
    "template": "base.html",
    "site": 1,
    "login_required": false,
    "limit_visibility_in_menu": null,
    "is_home": true,
    "application_urls": "",
    "application_namespace": null,
    "publisher_is_draft": false,
    "publisher_public": 4,
    "languages": "en",
    "revision_id": 0,
    "xframe_options": 0,
    "placeholders": [
      4,
      8
    ]
  }
},
{
  "model": "cms.page",
  "pk": 10,
  "fields": {
    "path": "0007",
    "depth": 1,
    "numchild": 0,
    "created_by": "script",
    "changed_by": "xxxx",
    "parent": null,
    "creation_date": "2018-01-31T19:56:22.494Z",
    "changed_date": "2018-02-04T18:49:06.843Z",
    "publication_date": "2018-01-31T19:57:23.405Z",
    "publication_end_date": null,
    "in_navigation": true,
    "soft_root": false,
    "reverse_id": null,
    "navigation_extenders": null,
    "template": "base.html",
    "site": 1,
    "login_required": false,
    "limit_visibility_in_menu": null,
    "is_home": false,
    "application_urls": null,
    "application_namespace": null,
    "publisher_is_draft": true,
    "publisher_public": 11,
    "languages": "en",
    "revision_id": 0,
    "xframe_options": 0,
    "placeholders": [
      26
    ]
  }
},]

Thanks in advance.


Solution

  • Your error is claiming that cms.page does not have a 'path' field, which could mean the model may not have the schema that you expect it to.