From 13f89300338e9d8ea3e3b669d5f2c30e58f4f3f1 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 17 Oct 2024 15:52:28 +0200 Subject: [PATCH] django-upgrade --target-version=5.1 **/*.py --- testproj/testproj/settings/base.py | 1 - testproj/testproj/settings/heroku.py | 9 ++++++++- testproj/testproj/urls.py | 2 +- 3 files changed, 9 insertions(+), 3 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: