Skip to content

migrate djac to Django cms 4

Philipp S. Sommer requested to merge django-cms-4 into master

on January 1st 2024 django-cms 4.1 has been released as the first community-based version. this MR implements the logic.

unfortunately not everything is working yet. We need to implement the fix in (which is ok via pipenv install git+

Furthermore, the migration needs to be prepared with the following commands:

from academic_community import models
from cms.models import Page, PagePermission

for link in models.InternalLink.objects.filter(
    page = Page.objects.get(pk=link.internal_link["pk"])
    if page.publisher_is_draft:
        link.config["internal_link"]["pk"] =

for perm in PagePermission.objects.filter(page__publisher_is_draft=True): =

for menu in models.MenuPluginModel.objects.filter(
    menu.root_id = menu.root_id.publisher_public


and (at least for the CLM-Community, but this is probably an artifact from the migration) we have some duplicated plugins that share the same position (identified via

# SELECT * FROM cms_cmsplugin INNER JOIN (SELECT placeholder_id, position, COUNT(*) FROM cms_cmsplugin GROUP BY placeholder_id, position HAVING COUNT(*) > 1) as foo USING (placeholder_id, position) INNER JOIN (SELECT * FROM cms_page_placeholders INNER JOIN cms_title USING (page_id)) as foo2 USING (placeholder_id) INNER JOIN academic_community_internalnamebootstrap5link ON ORDER BY placeholder_id;`

). These instances of InternalNameBootstrap5Link need to be deleted prior to the migration via

from academic_community import models

Edited by Philipp S. Sommer

Merge request reports