From 52017154ce3cc8f5f6e92ab08ccf7de2bfe5c6f1 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 17 Oct 2024 18:28:52 +0200 Subject: [PATCH] Add Django v5.0 and 5.1 to the testing (#902) --- testproj/testproj/settings/base.py | 1 - testproj/testproj/settings/heroku.py | 9 ++++++++- testproj/testproj/urls.py | 2 +- tox.ini | 11 +++++------ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/testproj/testproj/settings/base.py b/testproj/testproj/settings/base.py index 4e874014..110f9d0f 100644 --- a/testproj/testproj/settings/base.py +++ b/testproj/testproj/settings/base.py @@ -158,7 +158,6 @@ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True -USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) diff --git a/testproj/testproj/settings/heroku.py b/testproj/testproj/settings/heroku.py index 98c6b478..ccdcb342 100644 --- a/testproj/testproj/settings/heroku.py +++ b/testproj/testproj/settings/heroku.py @@ -19,7 +19,14 @@ # Simplified static file serving. # https://warehouse.python.org/project/whitenoise/ -STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' +STORAGES = { + "default": { + "BACKEND": "django.core.files.storage.FileSystemStorage", + }, + "staticfiles": { + "BACKEND": 'whitenoise.storage.CompressedManifestStaticFilesStorage', + }, +} MIDDLEWARE.insert(0, 'whitenoise.middleware.WhiteNoiseMiddleware') # Database diff --git a/testproj/testproj/urls.py b/testproj/testproj/urls.py index 23f45dd7..f7844162 100644 --- a/testproj/testproj/urls.py +++ b/testproj/testproj/urls.py @@ -36,7 +36,7 @@ def plain_view(request): def root_redirect(request): - user_agent_string = request.META.get('HTTP_USER_AGENT', '') + user_agent_string = request.headers.get('user-agent', '') user_agent = user_agents.parse(user_agent_string) if user_agent.is_mobile: diff --git a/tox.ini b/tox.ini index 4243327a..3d088b96 100644 --- a/tox.ini +++ b/tox.ini @@ -8,13 +8,11 @@ envlist = py{37,38,39}-django{22,30}-drf{310,311,312}, py{37,38,39}-django{31,32}-drf{311,312}, py{39,310}-django{40,41}-drf{313,314}, - # py311-django{40,41,42,50,51}-drf314, - py311-django{40,41,42}-drf314, - # py312-django{42,50,51}-drf314, - py312-django{42}-drf314, - # py313-django{51}-drf314, + py311-django{40,41,42,50,51}-drf315, + py312-django{42,50,51}-drf315, + py313-django{51}-drf315, py38-{lint, docs}, - # py313-djmaster + # py313-djmaster # ModuleNotFoundError: No module named 'psycopg' skip_missing_interpreters = true @@ -40,6 +38,7 @@ deps = drf312: djangorestframework>=3.12,<3.13 drf313: djangorestframework>=3.13,<3.14 drf314: djangorestframework>=3.14,<3.15 + drf315: djangorestframework>=3.15,<3.16 typing: typing>=3.6.6