Django问题 In order to allow non-dict objects to be serialized

return JsonResponse(data)

改为:

return JsonResponse(json.dumps(data), safe=False)

你可能感兴趣的:(Django问题 In order to allow non-dict objects to be serialized)