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的更多相关文章

  1. django framework插件类视图方法

    1.使用类视图APIView重写API 类视图APIView,取代@api_view装饰器,代码如下: from rest_framework import status from rest_fram ...

  2. 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 ...

  3. django framework相关的错误信息

    错误信息1: 报错信息: TypeError: In order to allow non-dict objects to be serialized set the safe parameter t ...

  4. django framework插件类视图分页

    分页 继承APIView类的视图中添加分页 from rest_framework.pagination import PageNumberPagination class MyPageNumberP ...

  5. Django之REST framework源码分析

    前言: Django REST framework,是1个基于Django搭建 REST风格API的框架: 1.什么是API呢? API就是访问即可获取数据的url地址,下面是一个最简单的 Djang ...

  6. 3- vue django restful framework 打造生鲜超市 - model设计和资源导入

    3- vue django restful framework 打造生鲜超市 - model设计和资源导入 使用Python3.6与Django2.0.2(Django-rest-framework) ...

  7. Django序列化&django REST framework

    第一章.Django序列化操作 1.django的view实现商品列表页(基于View类) # 通过json来序列化,但手写字典key代码量较大,容易出错:还有遇到时间,图片序列化会报错 from g ...

  8. “全能”选手—Django 1.10文档中文版Part4

    第一部分传送门 第二部分传送门 第三部分传送门 3.2 模型和数据库Models and databases 3.2.2 查询操作making queries 3.3.8 会话sessions 2.1 ...

  9. Django:之ORM、CMS和二维码生成

    Django ORM Django 的数据库接口非常好用,我们甚至不需要知道SQL语句如何书写,就可以轻松地查询,创建一些内容,所以有时候想,在其它的地方使用Django的 ORM呢?它有这么丰富的 ...

随机推荐

  1. HDU 6040 Hints of sd0061 nth_element函数

    Hints of sd0061 Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired ...

  2. bash的pushd和popd

    1 pushd和popd是bash shell的builtin命令 2 pushd和popd维护了一个目录栈 pushd xxx就是将xxx放入目录栈顶. 目录栈顶就是当前的目录. 但是cd的话,会不 ...

  3. $.post 使用案例

    $.post( aplnCommon.topUrl + 'ajaxLogin/ajaxLogin.action', { 'userLoginId' : userName, 'pwd' : userPw ...

  4. XMU C语言程序设计实践(5)

    •       使用动态链表完成一个简单的商品库存信息管理系统. •       商品信息包括如下字段:商品号.商品名称.商品库存 •       函数 create:接收用户输入的商品号和商品名称的 ...

  5. ubuntu gcc低版本过低引起错误

    错误内容: 正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成 您可能需要运行“apt-get -f install”来纠正下列错误:下列软件包有未满足的依赖关系: ...

  6. ie67 display:inline-block 失效解决方法

    先将其转化为块状,在转化为inline,*号为css hcak,代表针对IE67 display: inline-block; *display: block; *display: inline;

  7. SpringMVC配置环境中一般用的jar包

    配置SpringMVC需要把这些jar包加入lib目录下 下载地址,复制到地址栏.回车即可下载 http://files.cnblogs.com/files/QW-lzm/SpringMVC----. ...

  8. set built-in function

    集合类型 集合对象是一组无序排列的可哈希的值,集合可以作为字典的键.因为集合是无序的,不可以为集合创建索引或执行切片操作,也没有键可以用来获取元素的值. 集合有两种不同的类型,可变集合和不可变集合.可 ...

  9. 安装程序工具 (Installutil.exe)22

    网址:https://msdn.microsoft.com/zh-cn/library/50614e95(VS.80).aspx  安装程序工具 (Installutil.exe) .NET Fram ...

  10. SPOJ:House Fence(分治&DP)

    "Holiday is coming, holiday is coming, hurray hurray!" shouts Joke in the last day of his ...