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
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.