zoukankan      html  css  js  c++  java
  • python学习3-python views.py的返回值

    2.首先要说明一点是,对于HttpRequest对象来说,是Django自己创建的,但是HttpResponse就必须要我们自己创建。注意每个view方法都必须返回一个HttpResponse对象,HttpResonse对象也是在Django.http里面,这里我们看看之前一直用到的render函数:

    def render(request, template_name, context=None, context_instance=_context_instance_undefined, content_type=None, status=None, current_app=_current_app_undefined, dirs=_dirs_undefined, dictionary=_dictionary_undefined, using=None):
    ...........省略............ return HttpResponse(content, content_type, status) # 可以看到最后返回的就是个HttpResponse对象

  • 相关阅读:
    LR(0)分析法
    算符优先法之优先表构造
    自上而下的LL(1)语法分析法
    K倍区间
    全排列
    mysql自动获取时间日期
    限制
    JQuery
    LinQ 组合查询与分页
    LinQ 简单使用
  • 原文地址:https://www.cnblogs.com/gyadmin/p/10037220.html
Copyright © 2011-2022 走看看