- 配置好wfastcgi,将wfastcgi.py拷贝到项目根目录
- IIS添加项目网站
- 网站名称
- 物理路径(项目地址)
- 连接为(特定用户,输入用户密码)
- 端口
- 处理程序映射
- 点击“网站”中你的项目
- 点击右侧【处理程序映射】
- 在【处理程序映射】界面,右键【添加模块映射】编辑模块映射
- 请求路径:*
- 模块:FastCgiModule
- 可执行文件python位置|wfastcgi.py位置,如D:\python.exe|D:\connect\wfastcgi.py
- 请求限制,去掉映射下面的✔
- 确认添加模块
- FastCGI设置
- 主页(【网站】的上一级),进入【FastCGI设置】
- 双击刚才添加的FastCGI,【编辑FastCGI应用程序】
- 【环境变量】中添加
- PYTHONPATH :项目路径
- WSGI_HANDLER:启动文件.app 如app.app
附录:
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="FlaskFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="D:\python\soft\python.exe|D:\python\project\connect\wfastcgi.py" resourceType="Unspecified" />
</handlers>
</system.webServer>
<system.web>
<authentication mode="Windows" />
</system.web>
</configuration>