代码
return JsonResponse({"name": "tom"})
报错:
TYPEERROR: In order to allow non-dict objects to be serialized set the safe parmeter to False
解决:
return JsonResponse({"name": "tom"}, safe=False)
增加safe=false,使其接受列表
代码
return JsonResponse({"name": "tom"})
报错:
TYPEERROR: In order to allow non-dict objects to be serialized set the safe parmeter to False
解决:
return JsonResponse({"name": "tom"}, safe=False)
增加safe=false,使其接受列表