Python Flask App Stuck in Waiting for localhostRSS

1 reply

Last post Jan 31, 2020 11:42 AM by mirnesa

  • Python Flask App Stuck in Waiting for localhost

    Jan 27, 2020 10:14 PM|ksiil-ingredion|LINK

    I'm trying to run a flask app on a Server 2016 machine with IIS v10 and the httpplatformhander, here's my web.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.webServer>
        <handlers>
          <add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
        <httpPlatform processPath="C:\ProgramData\Anaconda3\python.exe" 
                      arguments="C:\Users\test\Documents\test_app\application.py" 
                      stdoutLogEnabled="true" 
                      stdoutLogFile="C:\Users\test\Documents\test_app\logs\acp.log" 
                      startupTimeLimit="60" 
                      processesPerApplication="16">
          <environmentVariables>
            <environmentVariable name="SERVER_PORT" value="%HTTP_PLATFORM_PORT%" />
          </environmentVariables>
        </httpPlatform>
      </system.webServer>
    </configuration>

    When I run `python application.py` in cmd it correctly opens my 'Hello, World!' app, but I can't seem to get it to work through the httpPlatformHandler.  I added IIS_IUSRS to the security options for my test_app folder and the anaconda3 folder.  Is there a location where I can see more detailed logs for diagnostics?

  • Re: Python Flask App Stuck in Waiting for localhost

    Jan 31, 2020 11:42 AM|mirnesa|LINK

    I have the same problem.

    You can see error in log file. I got this:

    AttributeError: 'NoneType' object has no attribute 'isatty': sys.stdin.isatty()

    Traceback is in this line:

    app.run() 

    Does flask needs something additional except httpPlatformHandler to run on IIS?