spiderweb/spiderweb/default_responses.py
2024-08-05 20:24:30 -04:00

14 lines
359 B
Python

from spiderweb.response import JsonResponse
def http403(request):
return JsonResponse(data={"error": "Forbidden"}, status_code=403)
def http404(request):
return JsonResponse(data={"error": f"Route {request.url} not found"}, status_code=404)
def http500(request):
return JsonResponse(data={"error": "Internal server error"}, status_code=500)