# 一 直接HttpResponse()返回数据
# 二 调用模板 使用render() 原型 render(request,templateName,context)
# 作用 结合数据和模板 返回完整的HTML页面
# 参数 request 请求体 templateName 模板路径 context 传递需要渲染在模板上的参数
# 属性
# content 返回的内容类型
# charset 编码格式
# content-type 指定的输出MIME类型
# status_code 状态码
# 方法
# init 使用页面内容实例化HttpResponse对象
# write(content) 文件形式写入
# flush() 以文件形式输出缓冲区
# set_cookie(key,value ,max_age None,exprise None) 设置cookie
# delete_cookie(key) 删除cookie 如果删除一个不存在的cookie 就无事发生
# 子类
# 子类HttpResponseRedirct 重定向 有一个redirect方法可以替代
# 子类JsonResponse json 可以返回json数据 一般用于异步请求 ajax请求 参数传入一个字典
# content-type application/json