Skip to content

Task/wp 1196 update django for ds#1716

Open
van-go wants to merge 23 commits into
mainfrom
task/WP-1196-Update-Django-for-DS
Open

Task/wp 1196 update django for ds#1716
van-go wants to merge 23 commits into
mainfrom
task/WP-1196-Update-Django-for-DS

Conversation

@van-go

@van-go van-go commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Overview

Update Django Version
The version being used by the lockfile is Django 4.2.27.
Django 4.2.x remains supported until April 2026.

Recommended target: Django 5.2.12 (latest 5.2 LTS patch).

PR Status

  • Ready.
  • Work in Progress.
  • Hold.

Related Links

Summary of Changes

pyproject.toml

Three dependency constraints changed:

  1. Django:
  • Before: >=4.2,<5.0.0
  • After: exactly 5.2.12
  1. django-filer:
  • Before: >=2.2,<3.0
  • After: >=3.0,<4.0
  • Required because filer 2.x explicitly restricts Django to <5.
  1. djangocms-text-ckeditor:
  • Before: 5.1, which resolved to 5.1.0
  • After: exactly 5.1.7
  • Fixes its use of Django APIs removed in Django 5.

poetry.lock

The lockfile was regenerated with Poetry 2.1.3. Principal resolved changes:

  1. Django 4.2.27 → 5.2.12
  2. django-filer 2.2.8 → 3.5.0
  3. djangocms-text-ckeditor 5.1.0 → 5.1.7
  4. Added py-svg-hush 0.3.0, required by the newer filer
  5. Removed filer dependencies no longer required:
  • django-mptt
  • django-js-asset
  1. Updated package constraints, artifact hashes, and the lockfile content hash

common_settings.py

Added the compatibility helper import:
from designsafe.settings.djangocms_forms_compat import apply_storage_compatibility
Then, after the Django 5 STORAGES configuration:

DEFAULT_FILE_STORAGE = STORAGES["default"]["BACKEND"]
apply_storage_compatibility()

This lets the archived forms plugin obtain its legacy setting from the authoritative Django 5 storage configuration. It does not introduce a separate storage configuration.

djangocms_forms_compat.py

This is a new compatibility adapter for djangocms-forms-maintained:

from django.core.files import storage
from django.utils.module_loading import import_string

It conditionally restores the removed get_storage_class function:

if not hasattr(storage, "get_storage_class"):
    storage.get_storage_class = import_string

The conditional makes it safe if the code is ever run with an older Django version where get_storage_class still exists.
This adapter is necessary because djangocms-forms-maintained still:

  • Reads the removed DEFAULT_FILE_STORAGE setting
  • Imports the removed django.core.files.storage.get_storage_class
    It should be removed once that archived plugin is replaced with a Django 5-native forms package.

Testing Steps

UI

Notes

van-go added 21 commits July 3, 2025 11:11
Comment on lines +296 to +299
# djangocms-forms-maintained still uses the pre-Django 5 storage API. Keep its
# configuration sourced from STORAGES until the archived plugin is replaced.
DEFAULT_FILE_STORAGE = STORAGES["default"]["BACKEND"]
apply_storage_compatibility()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update django-cms as well to not need this compatibility function?

@wesleyboar wesleyboar Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope so! Please tell me how this goes! I have long been worried about the form plugin, but 'django-cms>=3.0' suggests forms could still work.

Why Now Is the Right Time to Migrate from django CMS 3.11
— Django CMS Blog | Jan. 10, 2026

Comment thread pyproject.toml
attrdict = { git = "https://github.com/DesignSafe-CI/AttrDict", rev = "83b779ee82d5b0e33be695d398162b8f2430ff33" }
django-recaptcha2 = { git = "https://github.com/DesignSafe-CI/django-recaptcha2", tag = "v1.4.1--compat-django4" }
djangocms-cascade = { git = "https://github.com/DesignSafe-CI/djangocms-cascade", rev = "9e9f9e3088a0fcfdc1b27ad7e08b68390aa6a570" }
djangocms-cascade = { git = "https://github.com/van-go/djangocms-cascade.git", rev = "009a7d8ccc5e8b1ff645091fe6780af71a798b31" }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your compat/ branches look to be very far behind master. Intentional?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants