Files
plm-lottery/apps/web/views.py
T

18 lines
639 B
Python
Raw Normal View History

from django.db import connection
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
def home(request):
"""Placeholder landing page: the real home (WEB-10) arrives with A6."""
return render(request, "web/home.html")
def health_live(request):
"""Liveness for the container healthcheck: the process answers and the database opens (ARC-73)."""
try:
with connection.cursor() as cursor:
cursor.execute("SELECT 1")
except Exception:
return HttpResponse("database unavailable", status=503, content_type="text/plain")
return JsonResponse({"status": "ok"})