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呢?它有这么丰富的 ...
随机推荐
- Spark学习笔记:(一)入门 glance
参考: http://spark.apache.org/docs/latest/quick-start.html 其它资料: http://mojijs.com/2015/04/190845/i ...
- hadoop eclipse插件生成
hadoop eclipse插件生成 做了一年的hadoop开发.还没有自动生成过eclipse插件,一直都是在网上下载别人的用,今天有时间,就把这段遗憾补回来,自己生成一下,废话不说,開始了. 本文 ...
- 小程序登录方式切换 不做url跳转
var filegUP = require('../../utils/getUserPassword.js'); var filemd5 = require('../../utils/md5.min. ...
- IE8 下背景图标不显示
如图所示 : 微博微信前方各应有个图标,但是IE8下图标没有显示 css如下 .weibo_icon{background: url(../ieImages/weibo_icon.png)no-rep ...
- POJ3278 Catch That Cow —— BFS
题目链接:http://poj.org/problem?id=3278 Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total S ...
- YTU 2802: 判断字符串是否为回文
2802: 判断字符串是否为回文 时间限制: 1 Sec 内存限制: 128 MB 提交: 348 解决: 246 题目描述 编写程序,判断输入的一个字符串是否为回文.若是则输出"Yes ...
- YTU 2429: C语言习题 学生成绩输入和输出
2429: C语言习题 学生成绩输入和输出 时间限制: 1 Sec 内存限制: 128 MB 提交: 1897 解决: 812 题目描述 编写一个函数print,打印一个学生的成绩数组,该数组中有 ...
- hdu 1963 Investment 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1963 题目意思:有 本金 money,还有一些股票的种类,第 i 种股票买入需要 value[i] 这 ...
- 一步一步学Silverlight 2系列(14):数据与通信之WCF
一步一步学Silverlight 2系列(14):数据与通信之WCF 概述 Silverlight 2 Beta 1版本发布了,无论从Runtime还是Tools都给我们带来了很多的惊喜,如支持框 ...
- 书写优雅的shell脚本(插曲)- /proc/${pid}/status
Linux中/proc/[pid]/status详细说明 博客分类: OS Linux多线程 [root@localhost ~]# cat /proc/self/status Name: cat ...