大道藏经格 返回首页   发布资源   友情链接   联系我们
 

Deploy application based on web.py and mod_wsgi


How to deploy application based web.py.
格式:--
大小:--

mod_wsgi is a new Apache module which typically outperforms mod_python for hosting WSGI applications, and is very easy to set up.

At the end of your code.py, add:

app = web.application(urls, globals(), autoreload=False)
application = app.wsgifunc()

mod_wsgi offers many possible ways to expose a WSGI application in Apache\'s URL hierarchy, but one simple way would be to add the following to your .htaccess:

<Files code.py>
SetHandler wsgi-script
Options ExecCGI FollowSymLinks
</Files>

If you get an "ImportError: No module named web" in your apache error.log file, you could try setting the absolute path in code.py before importing web:

import sys, os
abspath = os.path.dirname(__file__)
sys.path.append(abspath)
os.chdir(abspath)

Important: Donnot forget create the .htaccess file, otherwise an internal error will be caused when call a function in other custom modules.

本资源由“Oh!Shareware”提交。
浏览本类别全部资源



截拳道之道

李小龙亲笔著作,不可多得的珍贵资料


正宗咏春木人桩法116式

叶问宗师亲自演示,叶准师傅著作


河南正宗心意拳

凶猛凌厉的内家武术


美国海军陆战队近距离格斗手册

彪悍实用的军用格斗技术

Acrobat Reader

用来阅读PDF电子书的阅读器软件。
点这里免费下载

ScarAngle

刀疤天使-优秀的电骡软件。
点这里免费下载

7-Zip

全能压缩解压缩软件,免费开源。
点这里免费下载
 
本站仅保存资源下载链接,不保存文件实体。本站搜藏系出于个人爱好,所有资源均来自搜索引擎和网友提交,如有侵权之处,请联系站长dadaorun#hotmail.com删除。