def__init__(self, data, encoder=DjangoJSONEncoder, safe=True,
json_dumps_params=None,**kwargs):if safe andnotisinstance(data,dict):raise TypeError('In order to allow non-dict objects to be serialized set the ''safe parameter to False.')if json_dumps_params isNone:
json_dumps_params ={}
kwargs.setdefault('content_type','application/json')
data = json.dumps(data, cls=encoder,**json_dumps_params)super(JsonResponse, self).__init__(content=data,**kwargs)