def JsonResponse(dump_object, xssi_protection=True):
 result = JsonDumpForScriptContext(dump_object)
 if xssi_protection:
  result = (')]}\n' + result)
 response = http.HttpResponse(result, content_type='application/json; charset=utf-8')
 response['Content-Disposition'] = 'attachment; filename=response.json'
 response['X-Content-Type-Options'] = 'nosniff'
 return response

def JsonResponse ( dump_object , xssi_protection = True ) : result = JsonDumpForScriptContext ( dump_object ) if xssi_protection : result = ( ')]}\n' + result ) response = http . HttpResponse ( result , content_type = 'application/json; charset=utf-8' ) response [ 'Content-Disposition' ] = 'attachment; filename=response.json' response [ 'X-Content-Type-Options' ] = 'nosniff' return response
return a django json response object with correct headers .