Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change static files serving to whitenoise plugin #1491

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gateway/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"whitenoise.runserver_nostatic",
"django.contrib.staticfiles",
"django.contrib.sites",
"django_prometheus",
Expand All @@ -85,6 +86,7 @@
"allow_cidr.middleware.AllowCIDRMiddleware",
"django_prometheus.middleware.PrometheusBeforeMiddleware",
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.common.CommonMiddleware",
Expand Down
2 changes: 0 additions & 2 deletions gateway/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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 @@ -49,7 +48,6 @@
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}),
Tansito marked this conversation as resolved.
Show resolved Hide resolved
]

if settings.DEBUG:
Expand Down
1 change: 1 addition & 0 deletions gateway/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ qiskit-ibm-runtime>=0.29.0
tzdata>=2024.1
django-cors-headers>=4.4.0, <5
parsley>=1.3, <2
whitenoise>=6.7.0, <7