Skip to content

Commit

Permalink
Fix serve static files (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito committed Aug 28, 2024
1 parent 877bce7 commit cdcff5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gateway/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
DEBUG = int(os.environ.get("DEBUG", 1))

# SECURITY WARNING: don't run with debug turned on in production!
LOG_LEVEL = "DEBUG" if int(os.environ.get("DEBUG", 1)) else "WARNING"
LOG_LEVEL = "DEBUG" if int(os.environ.get("DEBUG", 1)) else "INFO"

ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "*").split(",")

Expand Down
3 changes: 2 additions & 1 deletion gateway/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from django.conf import settings
from django.conf.urls.static import static
from django.views.static import serve
from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework import routers, permissions
Expand Down Expand Up @@ -48,8 +49,8 @@
path("", include("django_prometheus.urls")),
path("backoffice/", admin.site.urls),
re_path(r"^api/v1/", include(("api.v1.urls", "api"), namespace="v1")),
re_path(r"^static/(?P<path>.*)$", serve, {"document_root": settings.STATIC_ROOT}),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if settings.DEBUG:
urlpatterns += [
Expand Down

0 comments on commit cdcff5e

Please sign in to comment.