HttpResponse
used to return JSON response PYL-R5101It is recommended to use JsonResponse
to return JSON data instead of HttpResponse.
HttpResponse(json.dumps(data))
can be replaced with JsonResponse(data)
, where data
is a JSON-serializable object.