JsonResponse报错

使用Django框架在返回JsonResponse时,遇到报错信息:

In order to allow non-dict objects to be serialized set the safe parameter to False

 在JsonResponse()添加safe=False属性即可

return JsonResponse(list,safe=False)

猜你喜欢

转载自blog.csdn.net/wireless911/article/details/81156612