Skip to content

Commit 43a68b5

Browse files
committed
Update Django to 4.2 LTS
Django 3.2 reaches EOL at the end of this month. I could have sworn I'd upgraded to Django 4.2 long ago, but apparently not. Whoops. `USE_L10` is true by default, and is no longer honored in Django 5. Moving off the deprecated `STATICFILES_STORAGE` setting to the now-recommend `STORAGE` setting broke the post-processing steps to `collectstatic` without having first upgraded to `django-pipeline` version 3.
1 parent 5676804 commit 43a68b5

File tree

4 files changed

+18
-29
lines changed

4 files changed

+18
-29
lines changed

poetry.lock

+9-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ authors = ["David Cain <[email protected]>"]
144144
python = "^3.10.0"
145145

146146
[tool.poetry.group.prod.dependencies]
147-
Django = "^3.2"
147+
Django = "^4.2"
148148
PyJWT = ">= 2.0.0" # 2.0.0 changed the return type of `jwt.encode()`
149149
beautifulsoup4 = "*"
150150
celery = "^5.1"

ws/conf/test_settings.py

-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,3 @@
2828

2929
# Use the fast (but wildly insecure) MD5 to speed up tests.
3030
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
31-
32-
# We won't run `collectstatic` before executing tests.
33-
# `strict_manifest` doesn't seem to stop ValueError from being raised on non-found assets.
34-
# As a workaround, just use the default storage instead.
35-
# TODO: Figure out what's going on here, ideally after moving off django-pipeline
36-
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"

ws/settings.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@
5959
STATIC_URL = "/static/"
6060
STATIC_ROOT = os.getenv("STATIC_ROOT", os.path.join(BASE_DIR, "static"))
6161

62-
STATICFILES_STORAGE = "ws.storage.ManifestStorage"
62+
STORAGE = {
63+
"default": {
64+
"BACKEND": "django.core.files.storage.FileSystemStorage",
65+
},
66+
"staticfiles": {
67+
"BACKEND": "ws.storage.ManifestStorage",
68+
},
69+
}
6370

6471
STATICFILES_DIRS = [
6572
# For the legacy frontend, just put all the files directly in static root
@@ -318,7 +325,6 @@
318325
LANGUAGE_CODE = "en-us"
319326
TIME_ZONE = "America/New_York"
320327
USE_I18N = True
321-
USE_L10N = True
322328
USE_TZ = True
323329

324330
# Participants must update their profile information every ~6 months

0 commit comments

Comments
 (0)