Tsallaka zuwa abun ciki
Justice Tech School

JSON Responses

JsonResponse returns JSON.

Example
from django.http import JsonResponse

def api(request):
    return JsonResponse({"ok": True, "items": [1, 2]})

Exercise

JSON.

return ({"a": 1})

Quiz Test

What content type does it set?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.