JsonResponse和HttpResponse

1、联系

 JsonResponse继承HttpResponse

2、区别

 JsonResponse

数据类型装自动换成json字符串并相应到前端,传到前端的是数据类型而非json字符串

 HttpResponse

需要手动将字符串转化成json字符串并相应到前端,传到到前端的是json字符串,还需要手动进行转化

3、注意

JsonResponse()

'In order to allow non-dict objects to be serialized set the  'safe parameter to False.'
原文地址:https://www.cnblogs.com/wt7018/p/11346612.html