配置PYTHONHOME环境变量
http.conf中
LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so
WSGIPythonHome "C:\Python27"
AddType text/html .py
WSGIScriptAlias / "E:/python/web.py/workspace/my/index.py/"
Alias /static "E:/python/web.py/workspace/my/static"
<Directory "E:/python/web.py/workspace/my/">
AllowOverride all
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
SetHandler wsgi-script
Allow from all
</Directory>
<!-- 下面这两段是让这些静态资源不被wsgi处理-->
<Location "/static">
SetHandler None
</Location>
<Directory "E:/python/web.py/workspace/my/static/">
Order Deny,Allow
Allow from all
</Directory>
如果遇到 apache 出现no module named site的问题
需要加入:
WSGIPythonHome "你的python安装路径"