From 8689c4855ebad88d48b7a6c5e824741bc1567790 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 7 Jul 2023 14:55:38 +0100 Subject: [PATCH] feat: Add Django 4.2 support, but not later, to avoid non-LTS --- .github/workflows/ci.yml | 1 + CHANGELOG.md | 4 ++++ cove/settings.py | 5 ++++- setup.py | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3e8637..55aa19b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: - "Django>=3.0,<3.1" - "Django>=3.1,<3.2" - "Django>=3.2,<3.3" + - "Django>=4.2,<4.3" exclude: # Django 3.1+ supports Python 3.9. # https://docs.djangoproject.com/en/3.1/releases/3.1.3/ diff --git a/CHANGELOG.md b/CHANGELOG.md index cfa8f48..f98d649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Add + +- Support Django 4.2 https://github.com/OpenDataServices/lib-cove-web/issues/112 + # [0.27.0] - 2023-03-06 ## Changed diff --git a/cove/settings.py b/cove/settings.py index 90afc9d..358e26b 100644 --- a/cove/settings.py +++ b/cove/settings.py @@ -15,6 +15,7 @@ import os import warnings +import django from django.utils.crypto import get_random_string COVE_CONFIG = { @@ -139,7 +140,9 @@ USE_I18N = True -USE_L10N = True +if django.VERSION < (4,): + # USE_L10N is assumed from Django 4, and is not used in Django 5 + USE_L10N = True USE_TZ = True diff --git a/setup.py b/setup.py index c781233..ea4cad4 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ ], python_requires=">=3.7", install_requires=[ - "Django>=2.2,<3.3", + "Django>=2.2,<4.3", "django-bootstrap3", "requests", "django-environ",