diagnose-backend/educheck/views.py
pzc-x99 f56b66d8f1 /health/
/error_code_map/
/ec_user/*
/diagnose/*
/admin/*
2025-02-28 23:05:31 +08:00

16 lines
489 B
Python

# views.py
from django.shortcuts import render, get_object_or_404
from ec_user.models import EcUser
from django.http import JsonResponse
from django.conf import settings
def health_check(request):
return JsonResponse({"status": "ok", "version": "0.0.1"})
def error_code_map(request):
return JsonResponse(settings.ERROR_CODE_MAP)
def user_profile(request, user_id):
user = get_object_or_404(EcUser, id=user_id)
return render(request, 'user_profile.html', {'user': user})