diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd2b4b78ca2..4c811e291b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,8 @@ jobs: django-4.0.txt, django-4.1.txt, django-4.2.txt, - django-5.0.txt + django-5.0.txt, + django-5.1.txt ] os: [ ubuntu-20.04, @@ -28,10 +29,14 @@ jobs: python-version: 3.8 - requirements-file: django-5.0.txt python-version: 3.9 + - requirements-file: django-5.1.txt + python-version: 3.8 + - requirements-file: django-5.1.txt + python-version: 3.9 services: postgres: - image: postgres:12 + image: postgres:13 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -76,7 +81,8 @@ jobs: django-4.0.txt, django-4.1.txt, django-4.2.txt, - django-5.0.txt + django-5.0.txt, + django-5.1.txt ] os: [ ubuntu-20.04, @@ -86,6 +92,10 @@ jobs: python-version: 3.8 - requirements-file: django-5.0.txt python-version: 3.9 + - requirements-file: django-5.1.txt + python-version: 3.8 + - requirements-file: django-5.1.txt + python-version: 3.9 services: mysql: @@ -134,7 +144,8 @@ jobs: django-4.0.txt, django-4.1.txt, django-4.2.txt, - django-5.0.txt + django-5.0.txt, + django-5.1.txt ] os: [ ubuntu-20.04, @@ -144,6 +155,10 @@ jobs: python-version: 3.8 - requirements-file: django-5.0.txt python-version: 3.9 + - requirements-file: django-5.1.txt + python-version: 3.8 + - requirements-file: django-5.1.txt + python-version: 3.9 steps: - uses: actions/checkout@v3 diff --git a/cms/models/pagemodel.py b/cms/models/pagemodel.py index 20dba69ff0b..3cecb312e47 100644 --- a/cms/models/pagemodel.py +++ b/cms/models/pagemodel.py @@ -360,7 +360,7 @@ def _update_title_path_recursive(self, language, slug=None): base = self.get_path(language, fallback=True) if base: - new_path = Concat(models.Value(base), models.Value('/'), models.F('slug')) + new_path = Concat(models.Value(base), models.Value('/'), models.F('slug'), output_field=models.CharField()) else: # User is moving the homepage new_path = models.F('slug') @@ -386,7 +386,7 @@ def _set_title_root_path(self): # to include this page's slug as its path prefix (translations .filter(language=language) - .update(path=Concat(models.Value(slug), models.Value('/'), 'path'))) + .update(path=Concat(models.Value(slug), models.Value('/'), 'path', output_field=models.CharField()))) # Explicitly update this page's path to match its slug # Doing this is cheaper than a TRIM call to remove the "/" characters @@ -1190,7 +1190,7 @@ def mark_descendants_as_published(self, language): ) if base: - new_path = Concat(models.Value(base), models.Value('/'), models.F('slug')) + new_path = Concat(models.Value(base), models.Value('/'), models.F('slug'), output_field=models.CharField()) else: # User is moving the homepage new_path = models.F('slug') diff --git a/cms/utils/__init__.py b/cms/utils/__init__.py index 3b4cdff9fd8..e435974ea9f 100644 --- a/cms/utils/__init__.py +++ b/cms/utils/__init__.py @@ -1,6 +1,5 @@ # TODO: this is just stuff from utils.py - should be split / moved from django.conf import settings -from django.core.files.storage import get_storage_class from django.utils.functional import LazyObject from cms.utils.conf import get_site_id # nopyflakes @@ -54,7 +53,9 @@ def get_language_from_request(request, current_page=None): class ConfiguredStorage(LazyObject): def _setup(self): - self._wrapped = get_storage_class(getattr(settings, 'STATICFILES_STORAGE', default_storage))() + from django.utils.module_loading import import_string + + self._wrapped = import_string(getattr(settings, 'STATICFILES_STORAGE', default_storage))() configured_storage = ConfiguredStorage() diff --git a/setup.cfg b/setup.cfg index 48b478b685f..202ec22ce87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,6 +26,6 @@ skip = package-lock.json,*.js,*.po,./node_modules/*,./.idea/*,./docs/env/*,./doc [options] install_requires = - Django>=3.2 + Django>=3.2,<5.2 python_requires = >=3.7 diff --git a/setup.py b/setup.py index 4657e31b52f..33434e87e23 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Framework :: Django', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.1', @@ -36,6 +37,7 @@ 'Framework :: Django :: 4.1', 'Framework :: Django :: 4.2', 'Framework :: Django :: 5.0', + 'Framework :: Django :: 5.1', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', diff --git a/test_requirements/django-5.1.txt b/test_requirements/django-5.1.txt new file mode 100644 index 00000000000..62b070b6118 --- /dev/null +++ b/test_requirements/django-5.1.txt @@ -0,0 +1,2 @@ +-r requirements_base.txt +Django>=5.1,<5.2