http.py 251 B

1234567
  1. from django.http import HttpResponse, JsonResponse
  2. def make_json_response(code=200, **kwargs):
  3. if 'error' in kwargs:
  4. print(kwargs.get('error'))
  5. return JsonResponse({'code': code, **kwargs}, json_dumps_params={"ensure_ascii": False})