3

I am developing a website using Django 1.11 and Django-CMS with python3. Initially I used the default database sqlite3, however, now I want it to migrate to mysql. I have found several solutions online like

Solution 1

Solution 2

However, both did not work. For the first solution I got the following error:

AttributeError: 'Page' object has no attribute '_node_cache'

and for the second solution there was this error:

Could not load contenttypes.ContentType(pk=1): (1062, "Duplicate entry 'cms-placeholder' for key 'django_content_type_app_label_model_76bd3d3b_uniq'"

In both examples, I used a empty database and migrated first.

Any help please?

Dr3w Br1ck13
  • 187
  • 1
  • 5
  • 14

1 Answers1

1

Django's content types get tricky. Try deleting the content of django_content_type from the database after running migrations, but before loading the fixtures:

python manage.py dbshell
DELETE FROM django_content_type;

If it loads successfully, run migrations again to fill in any missing entries in django_content_type. Good luck!

FlipperPA
  • 13,607
  • 4
  • 39
  • 71