wfastcgi 2.2 + IIS 8 + Flask 0.10.1 + Python 3.5.1 = error
See original GitHub issueI am running a flask webapp of which standalone script runs fine. When it is integrated into IIS 8 with wfastcgi we get this error:
Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "c:\python\python34\lib\site-packages\wfastcgi.py", line 779, in main
env, handler = read_wsgi_handler(response.physical_path)
File "c:\python\python34\lib\site-packages\wfastcgi.py", line 621, in read_wsgi_handler
handler = get_wsgi_handler(os.getenv('WSGI_HANDLER'))
File "c:\python\python34\lib\site-packages\wfastcgi.py", line 594, in get_wsgi_handler
handler = handler()
TypeError: __call__() missing 2 required positional arguments: 'environ' and 'start_response'
StdOut:
StdErr:
web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="WSGI_HANDLER" value="app.app()" />
<add key="PYTHONPATH" value="C:\Flaskapp" />
</appSettings>
<system.webServer>
<!--<handlers accessPolicy="Read, Execute, Script" />-->
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<add name="Python FastCGI"
path="*" verb="*"
modules="FastCgiModule"
scriptProcessor="C:\python\python34\python.exe|c:\python\python34\lib\site-packages\wfastcgi.py"
resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
How can this be fixed? Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
wfastcgi 2.2 + IIS 8 + Flask 0.10.1 + Python 3.5.1 = error
I am running a flask webapp of which standalone script runs fine. When it is integrated into IIS 8 with wfastcgi we get...
Read more >Getting 500 Internal Server Error when setting up Python ...
I have below configuration settings on IIS 7.5 and running Python Flask with FastCgiModule. Here are the steps you can take:.
Read more >Getting 500 Internal Server Error when setting up Python and ...
Made sure the CGI windows feature was installed. In the IIS Manager, highlighted web server and in FastCGI Settings added an application with...
Read more >How to setup Flask web app on IIS in windows using Python ...
I've been struggling to get python 3.11 + flask app running within iis using wfastCGI. I havent found anythig about wfastcgi and 3.11...
Read more >wfastcgi
wfastcgi.py provides a bridge between IIS and Python using WSGI and FastCGI, similar to what mod_python provides for Apache HTTP Server.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The major document I read was wfastcgi on pypi: https://pypi.python.org/pypi/wfastcgi
I also googled with these key words “python flask iis”
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-python-django-web-app/
http://netdot.co/2015/03/09/flask-on-iis/
https://heejune.me/2015/04/22/running-python-flask-on-a-local-iis-not-azure-with-wfastcgi-py/
Most of the examples I have gone through were with blankets in WSGI_HANDLER value. We followed that and failed.
At a guess, your
WSGI_HANDLER
app setting should beapp.app
(without the trailing()
). That way,wfastcgi
will do:Currently, it’s doing this: