I am quite new to django and recently I have a requirement of a JSON output, for which I use the following django code:
data = serializers.serialize(\"json\", My
import json _all_data = Reporter.objects. all() json_data = json.dumps([{'name': reporter.full_name} for reporter in _all_data]) return HttpResponse(json_data, content_type='application/json')
Here Reporter is your Model