zoukankan      html  css  js  c++  java
  • Django-Request and Response objects

    翻译自:https://docs.djangoproject.com/zh-hans/2.2/ref/request-response/

    快速浏览

    Django使用 请求对象和相应对象(request and response objects )在系统中传递状态。

    当一个页面被请求时,Django创建一个HttpRequest object,该对象包含关于请求的元数据。然后Django加载适当的视图,将HttpRequest作为第一个参数传递给视图函数。每个视图都负责返回HttpResponse object。例如,

    # polls/views.py
    def
    detail(request, question_id): question = get_object_or_404(Question, pk=question_id) return render(request, 'polls/detail.html', {'question': question})
  • 相关阅读:
    事件的解除与绑定
    JavaScript 继承
    left 和 margin-left
    表格 DOM 操作
    基于继承的拖拽
    碰撞运动
    弹性运动
    完美运动框架
    JS 操作 Cookie
    DIV拖拽
  • 原文地址:https://www.cnblogs.com/daemonFlY/p/11504132.html
Copyright © 2011-2022 走看看