用HttpPlatformHandler替代wfastcgi,在IIS上部署python web应用

补充:请注意,以下这个配置并不适合用在生产环境,因为它启动的是开发环境的简易服务器,要用在生产环境还是需要配合HttpPlatformHandler + waitress (因为Gunicorn 和 uwsgi 不支持windows)

arguments="manage.py runserver %HTTP_PLATFORM_PORT%"

微软官方提示建议使用 HttpPlatform 配置应用,因为他们不再维护 WFastCGI 项目 了。

首先下载并安装HttpPlatformHandler  https://www.iis.net/downloads/microsoft/httpplatformhandler

然后直接把以下web.config复制保存到网站根目录

<?xml version="1.0" encoding="UTF-8"?>  
<configuration>  
 <system.webServer>

  <handlers>
    <add name="httpPlatformHandler" path="*" verb="*"
               modules="httpPlatformHandler" resourceType="Unspecified"/>
  </handlers>

  <httpPlatform processPath="D:\http\asp\www_mysite\venv\Scripts\python.exe" arguments="
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值