首先安装好wsgi模块并启用:
1.下载地址:我本机是python2.7 http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so
2.把mod_wsgi-win32-ap22py27-3.3.so放到apache安装目录下的modules目录下
3.打开 http.conf
添加:LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so

下载安装web.py模块:

easy_install -U web.py

下载安装web.py模块:

easy_install -U web.py

或者手动下载安装:

1.下载地址: http://webpy.org
2.解压到任意目录,进入目录python setup.py install,安装完毕后打开idle编辑器测试是否安装成功:

 >>> import web
>>> urls= ('/','index')
>>> app = web.application(urls,globals())
>>> class index:
def GET(self):
return 'hello world!' >>> app.run()

 在浏览器中浏览127.0.0.1:8080,查看是否能正常显示

开始设置

比如我以后想把试用web.py的程序都放在d:\develop\webapp目录下,并且访问连接为:127.0.0.1/webapp
配置如下:

 LoadModule wsgi_module modules/mod_wsgi.so

 WSGIScriptAlias /webapp "D:/develop/webapp/index.py/"

 Alias /webapp/static "D:/develop/webapp/static/"
AddType text/html .py <Directory "D:/develop/webapp/">
AllowOverride all
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
SetHandler wsgi-script
Allow from all
</Directory>

重启apache。

测试是否成功:

编辑:d:/develop/webapp/index.py文件:

 import web
urls = ('/','index') class index:
def GET(self):
return "hello world!" app = web.application(urls, globals(), autoreload=False)
application = app.wsgifunc()

  访问http://localhost/webapp, 配置完毕。

最新文章

  1. Mybatis获取插入记录的自增长ID(转)
  2. 读书笔记_Effective_C++_条款四十八:了解模板元编程
  3. php中对2个数组相加的函数
  4. ubuntu下php5扩展mysqli
  5. (转)IOS开发之——绘图(CGContext)
  6. ovs 实用案例
  7. 25+免费的Bootstrap HTML5网站模板
  8. HTTP状态码作用
  9. 让 .NET 更方便的导入导出 Excel
  10. LazyMan深入解析和实现
  11. 在eclipse中启动项目报java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
  12. zeromq学习笔记1——centos下安装 zeromq-4.1.2
  13. 5.无监督学习-DBSCAN聚类算法及应用
  14. linker command failed with exit code 1 (use -v to see invocation) 变量重名
  15. python之web开发利器
  16. GoodUserInterface 模仿页面功能
  17. 用 Qt 中的 QDomDocument类 处理 XML 文件
  18. oracle_存储过程_没有参数_根据配置自动创建申请单以及写日志事务回滚
  19. [BZOJ4836]二元运算(分治FFT)
  20. 标准IO与文件IO 的区别

热门文章

  1. Zencart先生成订单后付款,类似淘宝后台修改订单价格
  2. 过程需要类型为 &#39;ntext/nchar/nvarchar&#39; 的参数 &#39;@statement&#39;
  3. codeforces 620F. Xors on Segments
  4. divmod数字处理函数
  5. 我被SQL注入撞了一下腰
  6. DataTabe对象的例子
  7. android中使用setVideoURI()播放视频
  8. MapList 自己封装的
  9. JAVA GUI学习 - JTable表格组件学习_A ***
  10. MaxSubArray 最大子数列和