15 lines
352 B
Python
15 lines
352 B
Python
from django.db import connection
|
|
from django.http import JsonResponse
|
|
from django.shortcuts import render
|
|
|
|
|
|
def home(request):
|
|
return render(request, "index.html")
|
|
|
|
|
|
def health(request):
|
|
with connection.cursor() as cursor:
|
|
cursor.execute("SELECT 1")
|
|
cursor.fetchone()
|
|
return JsonResponse({"status": "ok", "database": "ok"})
|