Files
Hulumath-Web/backend/common/views.py
T
Jacky 6c9f475ba5
CI / test (pull_request) Successful in 3m58s
PR合并自动部署 / release-check (pull_request) Successful in 13s
PR合并自动部署 / deploy (pull_request) Successful in 16s
release: prepare Hulumath v1.2.0
2026-08-10 01:23:30 +08:00

22 lines
518 B
Python

from django.conf import settings
from django.db import connection
from django.http import JsonResponse
from django.shortcuts import render
def home(request):
return render(request, "index.html", {"app_version": settings.APP_VERSION})
def health(request):
with connection.cursor() as cursor:
cursor.execute("SELECT 1")
cursor.fetchone()
return JsonResponse(
{
"status": "ok",
"database": "ok",
"version": settings.APP_VERSION,
}
)