We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Python Flask App Stuck in Waiting for localhostRSS

2 replies

Last post Jun 25, 2021 05:49 AM by paviis

‹ Previous Thread|Next Thread ›
  • 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"?>
          <add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
        <httpPlatform processPath="C:\ProgramData\Anaconda3\python.exe" 
            <environmentVariable name="SERVER_PORT" value="%HTTP_PLATFORM_PORT%" />

    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:


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

  • Re: Python Flask App Stuck in Waiting for localhost

    Jun 25, 2021 05:49 AM|paviis|LINK

    Did you guys solve this issue?

‹ Previous Thread|Next Thread ›