HOWTO Use Python in the web — Python v3.0.1 documentation
HOWTO Use Python in the web — Python v3.0.1 documentation
mod_python¶
People coming from PHP often find it hard to grasp how to use Python in the web. Their first thought is mostly mod_python because they think that this is the equivalent to mod_php. Actually it is not really. It does embed the interpreter into the Apache process, thus speeding up requests by not having to start a Python interpreter every request. On the other hand, it is by far not “Python intermixed with HTML” as PHP often does. The Python equivalent of that is a template engine. mod_python itself is much more powerful and gives more access to Apache internals. It can emulate CGI, it can work an a “Python Server Pages” mode similar to JSP which is “HTML intermangled with Python” and it has a “Publisher” which destignates one file to accept all requests and decide on what to do then.
But mod_python has some problems. Unlike the PHP interpreter the Python interpreter uses caching when executing files, so when changing a file the whole web server needs to be re-started to update. Another problem ist the basic concept – Apache starts some child processes to handle the requests and unfortunately every child process needs to load the whole Python interpreter even if it does not use it. This makes the whole web server slower. Another problem is that as mod_python is linked against a specific version of libpython, it is not possible to switch from an older version to a newer (e.g. 2.4 to 2.5) without recompiling mod_python. mod_python is also bound to the Apache web server, so programs written for mod_python cannot easily run on other web servers.
These are the reasons why mod_python should be avoided when writing new programs. In some circumstances it might be still a good idea to use mod_python for deployment, but WSGI makes it possible to run WSGI programs under mod_python as well.
HOWTO Use Python in the web — Python v3.0.1 documentation的更多相关文章
- Maven异常:Dynamic Web Module 3.0 requires Java 1.6 or newer.
问题 我目前用的JDK 是java 1.8 ,搭建Maven项目的时候,设置Project facets后,出现来以下problem : Dynamic Web Module 3.0 requires ...
- 接口自动化 [授客]基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0
基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0 by:授客 QQ:1033553122 博客:http://blog.sina.com.cn/ishou ...
- 部署一个基于python语言的web发布环境
---恢复内容开始--- 1) 一门面向对象的语言 2)拥有丰富的库 3)可移植性 4)免费.开源 5)简单易易学 可做软件开发.人工智能.web开发等等 部署流程: Cnetos7.5+Nginx+ ...
- 基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0
基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0 目录 1. 开发环境2. 主要功能逻辑介绍3. 框架功能简介 4. 数据库的创建 5. 框架模块详细介绍6. Tes ...
- python的高性能web应用的开发与测试实验
python的高性能web应用的开发与测试实验 tornado“同步和异步”网络IO模型实验 引言 python语言一直以开发效率高著称,被广泛地应用于自动化领域: 测试自动化 运维自动化 构建发布自 ...
- Python轻量Web框架Flask使用
http://blog.csdn.net/jacman/article/details/49098819 目录(?)[+] Flask安装 Python开发工具EclipsePyDev准备 Flask ...
- 在sublimetext上打造一个兼容virtualenv的web&python开发环境
利用Sublimetext3&virtualenv 打造一个Web&Python IDE 注: 环境:window|python3;以下使用的sublimetext插件均用packag ...
- PSPInstance Object | Web Python
PSPInstance Object | Web Python The PSPInstance object is available to all PSP pages through the psp ...
- python 启动简单web服务器
有时我们在开发web静态页面时,需要一个web服务器来测试. 这时可以利用python提供的web服务器来实现. 1.在命令行下进入某个目录 2.在该目录下运行命令: python -m Simple ...
随机推荐
- 插入排序(Insertion Sort)
这是排序算法中最常见的排序方法,也是初学者使用最多的.有时候我们在生活中也会不自觉地用到插入排序,例如: 给手里的牌排序 这是最常见的例子之一,我们通常从纸牌的一边开始看,找到一张位置不正确的,把它拿 ...
- windows多线程同步总结
1.多线程同步与多线程互斥的关系 其实这也是我一直困扰的问题,在这里我只是说说我的理解.我的理解是多线程互斥是针对于多线程资源而言的. 而多线程同步是针对于多线程时序问题.由于线程的并发性导致其运行时 ...
- WEB程序会话管理--HttpSession和Cookie
WEB应用的会话管理的原理: 由于WEB应用的请求和响应是基于HTTP的,而HTTP由属于无状态的通信协议,只能记录本次请求的信息,因此服务器不会记住这一次的请求和下一次请求的关系.所以会话管理的原理 ...
- python高级编程之选择好名称:命名指南
# # -*- coding: utf-8 -*- # # python:2.x # __author__ = 'Administrator' #命名指南 #一组常用的命名规则可以被应用到变量,方法函 ...
- 修改UISearchBar输入框字体颜色
UITextField *searchField = [mySearchBar valueForKey:@"_searchField"]; searchField.textColo ...
- What is NetApp's Cluster File System?
Data ONTAP GX: A Scalable Storage Cluster www.usenix.org/event/fast07/tech/full_papers/eisler/eisler ...
- 从 mysql 客户端导出数据库 mysqldump
window+r 打开cmd 输入 mysqldump -u mysql用户名 -p 数据库名 > 要导出的位置 (注意,最后没有分号) 然后输入密码即可 ^_^
- Rss 的作用 及使用方法
也可以参考http://jingyan.baidu.com/article/e73e26c0c73e1f24adb6a70f.html 什么是RSS RSS是站点用来和其他站点之间共享内容的一种简易方 ...
- linux下查看文件及目录个数
linux下查看文件及目录个数1.查看当前文件和目录总数(不包括子目录):ls -l | wc -l 2.查看当前目录下文件个数(不包括子目录):ls -l |grep "^-"| ...
- node 安装express
环境:win7 64位旗舰版 1 安装nodejs 2 安装npm 3 安装express 重点介绍安装express,前提是你已经安装nodejs和npm了. 1 安装express npm ins ...