视图在接收请求并处理后,必须返回HttpResponse对象或子对象。HttpRequest对象由Django创建,HttpResponse对象由开发人员创建。 文章目录 响应报文组成 1. HttpResponse 2. HttpResponse子类 3. JsonResponse 4. redirect重定向 响应报文组成 HTTP/1.1 200 OK\r\n Server: Tengine\r\n Content-Type: text/html; charset=UTF-8\r\n Transfer-Encoding: chunked\r\n Connection: keep-alive\r\n Date: Fri