From ba1fb1a251e8a070260c9bed057497bb622fff04 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Thu, 21 Nov 2024 15:54:06 -0300 Subject: [PATCH] fixup: add staticfiles explicitly --- .ci/ansible/settings.py.j2 | 3 +++ pulpcore/app/settings.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.ci/ansible/settings.py.j2 b/.ci/ansible/settings.py.j2 index 80479fd94a..8fa43049e9 100644 --- a/.ci/ansible/settings.py.j2 +++ b/.ci/ansible/settings.py.j2 @@ -29,6 +29,7 @@ API_ROOT = {{ api_root | repr }} {% if s3_test | default(false) %} MEDIA_ROOT = "" STORAGES = { + "dynaconf_merge" = True, "default": { "BACKEND": "storages.backends.s3boto3.S3Boto3Storage", "OPTIONS": { @@ -52,6 +53,7 @@ S3_USE_SIGV4 = True {% if azure_test | default(false) %} MEDIA_ROOT = "" STORAGES = { + "dynaconf_merge" = True, "default": { "BACKEND": "storages.backends.azure_storage.AzureStorage", "OPTIONS": { @@ -69,6 +71,7 @@ STORAGES = { {% if gcp_test | default(false) %} STORAGES = { + "dynaconf_merge" = True, "default": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", "OPTIONS": { diff --git a/pulpcore/app/settings.py b/pulpcore/app/settings.py index 38ca4b23f6..f7da802d0f 100644 --- a/pulpcore/app/settings.py +++ b/pulpcore/app/settings.py @@ -56,7 +56,14 @@ STATIC_URL = "/assets/" STATIC_ROOT = DEPLOY_ROOT / STATIC_URL.strip("/") -STORAGES = {"default": {"BACKEND": "pulpcore.app.models.storage.FileSystem"}} +STORAGES = { + "default": {"BACKEND": "pulpcore.app.models.storage.FileSystem"}, + "staticfiles": { + # This is django's default, but when customizing STORAGES we need to add explicitly + # https://docs.djangoproject.com/en/4.2/ref/settings/#storages + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", + }, +} REDIRECT_TO_OBJECT_STORAGE = True