前提:已安装好 IIS、Python,并在IIS下添加了网站(没有Python环境,网站暂时还不能访问)。
Step1:安装 wFastCGI
pip install wfastcgi
Step2:复制 wfastcgi.py 到网站根目录
安装 wFastCGI 后,wfastcgi.py就位于Python根目录\Lib\site-packages下。
为什么要复制出来?因为一个 wfastcgi.py 只支持一个网站,若果你的IIS只跑一个Python网站,也可以不复制出来。
Step3:在网站根目录下添加一个 web.config 文件,并配置
【如果网站用Django开发,则配置如下】
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="wFastCGI_for_pifubanAPI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="D:\__Python__\python.exe|D:\_WebRoot_\pifubanAPI\wfas