diff --git a/compose.yaml b/compose.yaml index e4c72d30..48c4de34 100644 --- a/compose.yaml +++ b/compose.yaml @@ -102,7 +102,7 @@ services: - ./src/backend:/app - ./data/static:/data/static healthcheck: - test: ["CMD", "python", "-c", "import urllib.request as u; u.urlopen('http://localhost:8000/healthz/', timeout=1)"] + test: ["CMD", "python", "-c", "import urllib.request as u; u.urlopen('http://localhost:8000/api/v1.0/healthz/', timeout=1)"] interval: 3s retries: 3 start_period: 10s @@ -142,7 +142,7 @@ services: - ./src/backend:/app - ./data/static:/data/static healthcheck: - test: ["CMD", "python", "-c", "import urllib.request as u; u.urlopen('http://localhost:8000/healthz/', timeout=1)"] + test: ["CMD", "python", "-c", "import urllib.request as u; u.urlopen('http://localhost:8000/api/v1.0/healthz/', timeout=1)"] interval: 3s retries: 3 start_period: 10s diff --git a/src/backend/messages/urls.py b/src/backend/messages/urls.py index 4b6dc558..e05eb583 100644 --- a/src/backend/messages/urls.py +++ b/src/backend/messages/urls.py @@ -17,7 +17,7 @@ path(settings.ADMIN_URL, admin.site.urls), path("", include("core.urls")), path( - "healthz/", + f"api/{settings.API_VERSION}/healthz/", lambda _: HttpResponse("OK"), name="healthcheck", ), diff --git a/src/backend/messages/wsgi.py b/src/backend/messages/wsgi.py index 29e43f8c..9e306071 100644 --- a/src/backend/messages/wsgi.py +++ b/src/backend/messages/wsgi.py @@ -9,6 +9,8 @@ import os +from django.conf import settings + from configurations.wsgi import get_wsgi_application # pylint: disable=all @@ -19,7 +21,10 @@ class QuietWSGIRequestHandler(django.core.servers.basehttp.WSGIRequestHandler): def log_message(self, format, *args): path = getattr(self, "path", "") - if path.strip("/") == "healthz": + if ( + path.split("?", 1)[0].rstrip("/") + == f"/api/{settings.API_VERSION}/healthz" + ): return super().log_message(format, *args)