Django framework
2016-01-16 13:09
585 查看
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.
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.
相关文章推荐
- Golang初级系列教程-接口
- golang(2):beego 环境搭建
- HDU 4981 Goffi and Median(水)
- django 第一个项目-学习搭建博客 (四、Django url 和视图)
- Go学习笔记(3)字符串
- Golang初级系列教程-多重继承
- django 第一个项目-学习搭建博客 (三、Django admin 管理后台)
- django 第一个项目-学习搭建博客 (二、Django模型)
- Go学习笔记(2) 语言基础和数值布尔类型
- django 第一个项目-学习搭建博客 (一、建立工程)
- Go学习笔记(1)Go语言介绍
- UVA11090 Going in Cycle!! (二分+SPFA推断有无负权)
- GO求平均值
- 【Go学习笔记】Hello Go!
- 【Go学习笔记】Win7 环境搭建
- django 学习-16 Django会话Cookie
- Educational Codeforces Round 5 D. Longest k-Good Segment
- google perftools分析程序性能
- Good Bye 2015
- 蓝桥杯 上帝造题五分钟