diff --git a/requirements.txt b/requirements.txt index de6e6a6..65a769f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Django>=4.2,<4.3 wagtail>=6.2 psycopg>=3.1.8,<4.0 -social-auth-app-django==5.4.2 \ No newline at end of file +social-auth-app-django==5.4.2 +django-health-check==3.18.3 diff --git a/tgno/settings/base.py b/tgno/settings/base.py index cf8beca..55e6c86 100644 --- a/tgno/settings/base.py +++ b/tgno/settings/base.py @@ -49,6 +49,11 @@ "wagtail", "modelcluster", "taggit", + "health_check", + "health_check.db", + "health_check.cache", + "health_check.storage", + "health_check.contrib.migrations", "social_django", "django.contrib.admin", "django.contrib.auth", @@ -207,3 +212,5 @@ if DISABLE_LOCAL_AUTH is False: AUTHENTICATION_BACKENDS.append("django.contrib.auth.backends.ModelBackend") + +HEALTH_CHECK = {"SUBSETS": {"liveness": ["DatabaseBackend"]}} diff --git a/tgno/urls.py b/tgno/urls.py index fda5d2c..f38c86b 100644 --- a/tgno/urls.py +++ b/tgno/urls.py @@ -12,6 +12,7 @@ from .api import api_router as base_api_router urlpatterns = [ + path(r"backend-health/", include("health_check.urls")), path("django-admin/", admin.site.urls), path("admin/", include(wagtailadmin_urls)), path("", include("social_django.urls")),