我正在尝试在 IIS 中部署 Flask 应用程序。
但是我收到 500 FastCGI 错误。
错误代码:“0x8007010b”
以下是我采取的步骤:
操作系统:windows10
Python版本:3.6.5
1.安装url rewrite2.0
2.pip安装wfastcgi
3.启用wfastcgi
4.创建HelloAPI.py
5.创建web.config
你好API.py
from flask import Flask
app=Flask(__name__)
@app.route('/',methods=['GET'])
def index():
return "Hello Flask!"
if __name__=='__main__':
app.run(debug=True)
网页配置
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="FlaskFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="d:\users\hhhung1\appdata\local\programs\python\python36-32\python.exe|d:\users\hhhung1\appdata\local\programs\python\python36-32\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<security>
<requestFiltering allowDoubleEscaping="true"></requestFiltering>
</security>
</system.webServer>
<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="HelloAPI.app" />
<add key="PYTHONPATH" value="~/" />
</appSettings>
</configuration>
有什么我想念的吗?
侃侃无极
catspeake
相关分类