def json_response_from(response): jsonSerializer = JSONSerializer() return HttpResponse(jsonSerializer.serialize(response, use_natural_keys=True), mimetype='application/json')
def json(data): jsonSerializer = JSONSerializer() return jsonSerializer.serialize(data)