[Answer]-Invalid response of JSON data from Django QuerySet

1👍

Instead of

return HttpResponse(flood_hazard, content_type='application/json')

Try

return HttpResponse(json.dumps(flood_hazard), content_type='application/json')

You will have to import json at the top.

👤Kedar

Leave a comment