Skip to content

Commit

Permalink
fixup: add staticfiles explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Nov 21, 2024
1 parent 43e398e commit ba1fb1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .ci/ansible/settings.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -69,6 +71,7 @@ STORAGES = {

{% if gcp_test | default(false) %}
STORAGES = {
"dynaconf_merge" = True,
"default": {
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
"OPTIONS": {
Expand Down
9 changes: 8 additions & 1 deletion pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ba1fb1a

Please sign in to comment.