Django framework
1. Django 的内置web server是如何实现的
2. Django 的WSGI是如何实现的
3. Django middle ware是如何实现的
4. Django framework的workflow, 从request 进来到response 出去
5. Django 和数据库的连接,model的工作原理
Django 的 WSGI Server 用的是 wsgiref.simple_server
WSGI APP 是 core.handler.wsgi.wsgihander
WSGIRequest实际上就是一个dict 持有原始request里的数据
WSGIHandler 返回HTTPResponse (所以HTTPResponse也是iterable的, 像list 一样?)
WSGIHandler 会去读 urlconfig找到view,会去读setting,例如middleware的配置
middleware的调用也是在WSGIHandler中
WSGI APP 必须具有下面的接口
def __call__(self, environ, start_response):
start_response is also callable object created by WSGIServer.
WSGI APP will transfer the status and headers to WSGIServer through this callable object.
Also WSGI APP must return a list similar response to WSGIServer.
In the end, WSGIServer will collect the headers and response together and send back to client.
Django framework的更多相关文章
- django framework插件类视图方法
1.使用类视图APIView重写API 类视图APIView,取代@api_view装饰器,代码如下: from rest_framework import status from rest_fram ...
- django framework插件使用1
安装 REST框架要求以下内容: Python(3.5.3.6.3.7) Django(1.11.2.0.2.1.2.2) pip install djangorestframework pip in ...
- django framework相关的错误信息
错误信息1: 报错信息: TypeError: In order to allow non-dict objects to be serialized set the safe parameter t ...
- django framework插件类视图分页
分页 继承APIView类的视图中添加分页 from rest_framework.pagination import PageNumberPagination class MyPageNumberP ...
- Django之REST framework源码分析
前言: Django REST framework,是1个基于Django搭建 REST风格API的框架: 1.什么是API呢? API就是访问即可获取数据的url地址,下面是一个最简单的 Djang ...
- 3- vue django restful framework 打造生鲜超市 - model设计和资源导入
3- vue django restful framework 打造生鲜超市 - model设计和资源导入 使用Python3.6与Django2.0.2(Django-rest-framework) ...
- Django序列化&django REST framework
第一章.Django序列化操作 1.django的view实现商品列表页(基于View类) # 通过json来序列化,但手写字典key代码量较大,容易出错:还有遇到时间,图片序列化会报错 from g ...
- “全能”选手—Django 1.10文档中文版Part4
第一部分传送门 第二部分传送门 第三部分传送门 3.2 模型和数据库Models and databases 3.2.2 查询操作making queries 3.3.8 会话sessions 2.1 ...
- Django:之ORM、CMS和二维码生成
Django ORM Django 的数据库接口非常好用,我们甚至不需要知道SQL语句如何书写,就可以轻松地查询,创建一些内容,所以有时候想,在其它的地方使用Django的 ORM呢?它有这么丰富的 ...
随机推荐
- What is the difference between message queue pattern and publish-subscribe?
What is the difference between message queue pattern and publish-subscribe? - Quora https://www.quor ...
- 20170228 Z_po_send_email
FUNCTION zmm_po_send_email. function zmm_po_send_email. *"------------------------------------- ...
- MySQL table
-- 使用数据库hr use hr; -- 在数据库中创建表-- ------------------------------------JOBS表-------------------------- ...
- Ruby map、each、select、inject、collect 、detect reference
参考 https://ruby-china.org/topics/26718 map:(collect是map的别名函数) 对数组中每个元素进行表达式操作,原始数组不会被改变,返回执行表达式结果的新数 ...
- hdu 超级楼梯 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2041 哦--对了,这些题读者可以直接忽略,我只是想练习一下自己薄弱的地方...... 题目意思我就不说 ...
- Java经典算法大全
1.河内之塔.. 2.Algorithm Gossip: 费式数列. 3. 巴斯卡三角形 4.Algorithm Gossip: 三色棋 5.Algorithm Gossip: 老鼠走迷官(一) 6. ...
- 【原】WPF客户端只能启动一次
public partial class App : Application { System.Threading.Mutex mutex; public App() { this.Startup + ...
- OpenMediaVault GitLab 安装
/**************************************************************************** * OpenMediaVault GitLa ...
- boost之timer
1. timer类实现 #pragma once #include <ctime> #include <limits> class timer { public: timer( ...
- jsch上传文件功能
转载:http://www.cnblogs.com/longyg/archive/2012/06/25/2556576.html JSch是Java Secure Channel的缩写.JSch是一个 ...