惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - 墨墨

Windows Phone 7中配置gmail, 使用outlook 同步邮件,日历,联系人等 iPhone 闭包应用 iPhone屏幕旋转的例子 objective-c的TextFields输入完成后关闭键盘和触摸背景关闭键盘 第一个iPhone程序之Hello World 第一个objective-c程序 iPhone自动化测试 visual studio 2010 ultimate 下载 suse下设置IP的两种方法 freebsd下之简单安装python ibatis.net私人学习资料,勿下(加密) ibatisnet高级查询 Python相关中文学习资料 使用Aptana搭建Python开发环境 使用SharpZipLib 解压zip 2012年真的是世界末日吗?_全球关注 关于生成静态页--终极解决方案 Json格式类的转换相关代码 Extjs 登录界面源码
搭建python的web开发环境 windows下
墨墨 · 2009-11-02 · via 博客园 - 墨墨

本文以Windows XP/Windows 2003为例,介绍windows环境下Python web开发环境的安装配置:

1. 安装Apache
    下载win32版的Apache msi程序直接安装即可,我用的版本是: apache_2.2.9-win32-x86-no_ssl-r2.msi,下载地址:http://apache.freelamp.com/httpd/binaries/win32/apache_2.2.9-win32-x86-no_ssl-r2.msi。下载后直接安装,一路Next安装完成。

2. 安装Python
      下载win32版的ActivePython msi程序直接安装即可,我用的版本是python 2.5,安装过程请大家参考:http://www.shuihan.com/article/410.htm

3. 安装mod_python
     Mod_python是apache 中支持Python CGI的模块。直接下载win32版的安装程序安装即可,我用的是Apache Mod_python 3.3.1。安装程序会自己找到Python的安装目录,在Python的Lib\site-packagesib下增加目录mod_python。
   Apache Mod_python 3.3.1下载地址:mod_python-3.3.1.win32-py2.5-Apache2.2.exe
    安装过程中安装程序让你找Apache2.2的安装目录,选择刚才你安装Apache的目录即可。

4. 数据库驱动程序安装
    Web程序如果需要访问数据库,必须安装相应数据库的驱动程序。我用的是MySQL数据库,直接下载win32版安装即可,我用的是MySQL-python.exe-1.2.1_p2.win32-py2.4.exe。安装程序会在Python的Lib\site-packagesib下增加目录MySQLdb。

5. 配置Apache
    在Apache的配置文件(Apache安装目录下conf\httpd.conf文件)中增加一行加载mod_python:
LoadModule python_module libexec/mod_python.so。配置文件在Apache的安装目录下:
Apache Group\Apache2_2\conf\httpd.conf

6. 测试
    (1)  Apache的DocumentRoot目录下增加目录配置,DocumentRoot通常是Apache安装目录下的Apache Group\Apache2\htdocs。下面是我的配置:

程序代码

<Directory C:/Program Files/Apache Group/Apache2/htdocs/testpython>
  AddHandler mod_python py
  PythonHandler testMyFirstPage.py
  PythonDebug On
</Directory>

    (2)  编写testMyFirstPage.py,保存于testpython下。代码如下:

程序代码

from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK