register and sign in pages
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from django.db import connection
|
||||
from rest_framework.decorators import api_view, authentication_classes, permission_classes
|
||||
from rest_framework.response import Response
|
||||
|
||||
|
||||
@api_view(["GET"])
|
||||
@authentication_classes([])
|
||||
@permission_classes([])
|
||||
def healthcheck(request):
|
||||
"""Liveness + database reachability, for compose/nginx health probes."""
|
||||
try:
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute("SELECT 1")
|
||||
database = "up"
|
||||
except Exception: # pragma: no cover - reported, not raised
|
||||
database = "down"
|
||||
return Response({"status": "ok", "database": database})
|
||||
Reference in New Issue
Block a user