From a631d6bb72150d40e98f05d6732295f8ba0e7fc2 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Tue, 7 Nov 2023 10:51:42 +0000 Subject: [PATCH] Update default project settings to use STORAGES instead of STATICFILES_STORAGE We've bumped the template's requirements to use Django >= 4.2, so STATICFILES_STORAGE is deprecated --- .../project_name/settings/base.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/wagtail/project_template/project_name/settings/base.py b/wagtail/project_template/project_name/settings/base.py index 9afb9b64a4..7111fa71bf 100644 --- a/wagtail/project_template/project_name/settings/base.py +++ b/wagtail/project_template/project_name/settings/base.py @@ -137,17 +137,27 @@ STATICFILES_DIRS = [ os.path.join(PROJECT_DIR, "static"), ] -# ManifestStaticFilesStorage is recommended in production, to prevent outdated -# JavaScript / CSS assets being served from cache (e.g. after a Wagtail upgrade). -# See https://docs.djangoproject.com/en/{{ docs_version }}/ref/contrib/staticfiles/#manifeststaticfilesstorage -STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" - STATIC_ROOT = os.path.join(BASE_DIR, "static") STATIC_URL = "/static/" MEDIA_ROOT = os.path.join(BASE_DIR, "media") MEDIA_URL = "/media/" +# Default storage settings, with the staticfiles storage updated. +# See https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#std-setting-STORAGES +STORAGES = { + "default": { + "BACKEND": "django.core.files.storage.FileSystemStorage", + }, + # ManifestStaticFilesStorage is recommended in production, to prevent + # outdated JavaScript / CSS assets being served from cache + # (e.g. after a Wagtail upgrade). + # See https://docs.djangoproject.com/en/{{ docs_version }}/ref/contrib/staticfiles/#manifeststaticfilesstorage + "staticfiles": { + "BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage", + }, +} + # Wagtail settings