Skip to content

Commit

Permalink
fix: STATICFILES_DIRS
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Dec 3, 2024
1 parent 1d58901 commit 990aec1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .deploy/service.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"AWS_S3_REGION_NAME": "${AWS_S3_REGION_NAME}",
"AWS_DEFAULT_ACL": "${AWS_DEFAULT_ACL}",
"AWS_LOCATION": "${AWS_LOCATION}",
"AWS_S3_CUSTOM_DOMAIN": "${AWS_S3_CUSTOM_DOMAIN}"
"AWS_S3_CUSTOM_DOMAIN": "${AWS_S3_CUSTOM_DOMAIN}",
"STATICFILES_DIRS": "${STATICFILES_DIRS}"
}
}
]
Expand Down
5 changes: 5 additions & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ def get_health_check(self, request):
description=str(settings.AWS_S3_REGION_NAME),
health="healthy",
),
HealthCheck.Detail(
name="STATICFILES_DIRS",
description=str(settings.STATICFILES_DIRS),
health="healthy",
),
],
)

Expand Down
6 changes: 5 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
# STATIC_ROOT = get_static_root(BASE_DIR)
STATIC_ROOT = os.getenv("STATIC_ROOT", BASE_DIR / "static")
STATIC_URL = os.getenv("STATIC_URL", "/static/")
# STATICFILES_DIRS = ["static"]
STATICFILES_DIRS = (
os.environ["STATICFILES_DIRS"].split(",")
if os.getenv("STATICFILES_DIRS")
else []
)

# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
Expand Down

0 comments on commit 990aec1

Please sign in to comment.