[Flask] Problem of wfastcgi + flask + IIS 8 + python 3.5

Darren Chuck darren.chuck at gmail.com
Wed Apr 27 02:50:10 EDT 2016


Hi there,

After setting web.config, we get the following error:

Error occurred while reading WSGI handler: Traceback (most recent call
last): File "c:\python\python35\lib\site-packages\wfastcgi.py", line 779,
in main env, handler = read_wsgi_handler(response.physical_path) File
"c:\python\python35\lib\site-packages\wfastcgi.py", line 621, in
read_wsgi_handler handler = get_wsgi_handler(os.getenv('WSGI_HANDLER'))
File "c:\python\python35\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:

Is it because of compatibility or have we wrongly configured?

The web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appSettings>
    <add key="WSGI_HANDLER" value="app.app()" />
    <add key="PYTHONPATH"
value="D:\python\FlaskWebProject1;D:\python\FlaskWebProject1\FlaskWebProject1\mymodule\"
/>
    <add key="WSGI_LOG" value="D:\python\Logs\my_app.log" />
  </appSettings>
  <system.webServer>
    <!--<handlers accessPolicy="Read, Execute, Script" />-->
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <add name="Python FastCGI"
  path="*"
  verb="*"
  modules="FastCgiModule"

scriptProcessor="C:\python\python35\python.exe|c:\python\python35\lib\site-packages\wfastcgi.py"
  resourceType="Unspecified"
  requireAccess="Script" />
    </handlers>
    <rewrite>
      <rules>
        <rule name="Static Files" stopProcessing="true">
          <conditions>
            <add input="true" pattern="false" />
          </conditions>
        </rule>
        <rule name="Configure Python" stopProcessing="true">
          <match url="(.*)" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="^/static/.*"
ignoreCase="true" negate="true" />
          </conditions>
          <action type="Rewrite"
                  url="handler.fcgi/{R:1}"
                  appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>



Thanks,
--Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160427/2e070002/attachment.html>


More information about the Flask mailing list