Answer the question
In order to leave comments, you need to log in
How to run Flask on IIS 7.5 via wfastcgi.py?
We have Windows Server 2008 R2, IIS 7.5, Python 3.5.2, Flask 0.11, wfastcgi.py 2.2, we need to earn it all together.
I do everything according to the instructions:
1) the FastCGI module is installed on IIS
2) the main script c:\MyApp\myapp.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello World!"
if __name__ == "__main__":
app.run()
<configuration>
<system.webServer>
<handlers>
<add name="Python FastCGI"
path="*"
verb="*"
modules="FastCgiModule"
scriptProcessor="C:\Python35\python.exe|C:\Python35\Lib\site-packages\wfastcgi.py"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="myapp.app" />
<add key="PYTHONPATH" value="C:\MyApp" />
<!-- Optional settings -->
<add key="WSGI_LOG" value="C:\Logs\myapp.log" />
<add key="WSGI_RESTART_FILE_REGEX" value=".*((\.py)|(\.config))$" />
</appSettings>
</configuration>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question