JsonResponse类 导入方式 from django.http import JsonResponse 用来dump成json字符串, 返回给浏览器, 并且他的content-Type是application/json 直接使用json数据类型 import json def index3(request): p = { 'name': 'zs', '