title: Python Flask Hosting on Windows 10 IIS server
body: <p>I Want to Host my Python Rest API on Windows 10 IIS server.</p>
  <p>First I tried to host a sample application but can not able to that.</p>
  <p><strong>my_app.py</strong></p>
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  @app.route('/')
  def index():
      return 'Hello IIS from Flask framework.'
  
  @app.route('/Hello')
  def hello_world():
      return 'Hello World!'
      
  if __name__ == '__main__':
      app.run()
  </code></pre>
  <p><strong>web.config</strong></p>
  <pre><code>&lt;configuration&gt;  
    &lt;system.webServer&gt;
      &lt;handlers&gt;
          &lt;add name=&quot;Python FastCGI&quot;
              path=&quot;*&quot;
              verb=&quot;*&quot;
              modules=&quot;FastCgiModule&quot;
              scriptProcessor=&quot;C:\Program Files\Python39\python.exe|C:\Program Files\Python39\lib\site-packages\wfastcgi.py&quot;
              resourceType=&quot;Unspecified&quot;
              requireAccess=&quot;Script&quot; /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;appSettings&gt;
      &lt;add key=&quot;WSGI_HANDLER&quot; value=&quot;my_app.app&quot; /&gt; &lt;!-- {name_of_file}.{name_of_flask_app}--&gt;
      &lt;add key=&quot;PYTHONPATH&quot; value=&quot;C:\inetpub\wwwroot\test&quot; /&gt;
      &lt;add key=&quot;WSGI_LOG&quot; value=&quot;C:\inetpub\wwwroot\test\app.log&quot; /&gt;
    &lt;/appSettings&gt;
  &lt;/configuration&gt;  
  </code></pre>
  <p>I have tried the below tutorials but it is not working for me.</p>
  <ol>
  <li><p><a href="https://medium.com/@rajesh.r6r/deploying-a-python-flask-rest-api-on-iis-d8d9ebf886e9" rel="nofollow noreferrer">https://medium.com/@rajesh.r6r/deploying-a-python-flask-rest-api-on-iis-d8d9ebf886e9</a></p>
  </li>
  <li><p><a href="https://www.youtube.com/watch?v=ma1UvzqF82Q&amp;ab_channel=ShobhitWalia" rel="nofollow noreferrer">https://www.youtube.com/watch?v=ma1UvzqF82Q&amp;ab_channel=ShobhitWalia</a></p>
  </li>
  </ol>
  <p>HTTP Error 500.0 - Internal Server Error : <a href="https://i.stack.imgur.com/ocPac.png" rel="nofollow noreferrer">see the Error scrennshot</a></p>
  <p>I need help....  Thanks</p>