diango中三种response对象的方法

HttpResponse('xxxx')  # 返回字符串   Content-Type: text/html; charset=utf-8
render(request,'模板的路径',{})   # 返回一个页面
redirect('路径')   # 重定向  状态码301 302  响应头 Location:路径


from django.http.response import JsonResponse
posted @ 2019-12-19 18:33  谢国宏  阅读(363)  评论(0编辑  收藏  举报