title: Flask - How to make an app externally visible through a router?
body: <p><strong>The question in short</strong></p>
  
  <p>How do you run a simple Flask-based website visible to the internet, from a host PC which is accessing the internet <strong><em>from a wireless router</em></strong>?</p>
  
  <p><strong>Question details</strong></p>
  
  <p>I would like to make a flask application visible to the internet, as per <a href="http://flask.pocoo.org/docs/0.10/quickstart/#a-minimal-application" rel="noreferrer">Quickstart Guide</a>.</p>
  
  <p>If I launch the simple Flask app below, it becomes accessible from a computer on the same network as the host pc, but not from a device connected through the internet through another network.</p>
  
  <p>The problem is similar to the one discussed <a href="https://stackoverflow.com/questions/18630930/python-flask-expose-to-external-visible">here</a> and <a href="https://groups.google.com/forum/#!topic/utahpython/RFFdwBVKWz0" rel="noreferrer">here</a>, with the added element that running from a home pc seems to suggest that external connections point to the xx port of the router, not to the xx port of the host pc, as is suggested in the comments in <a href="https://stackoverflow.com/questions/18630930/python-flask-expose-to-external-visible">this post</a>.</p>
  
  <p><strong>What I did</strong></p>
  
  <p>Referencing the code below, here's what I did:</p>
  
  <ul>
  <li>Checked my <a href="http://help.virginmedia.com/system/selfservice.controller?CMD=VIEW_ARTICLE&amp;ARTICLE_ID=2925&amp;CONFIGURATION=1001&amp;PARTITION_ID=1" rel="noreferrer">IP address</a> in Control Panel</li>
  <li>disabled all network protection in the antivirus</li>
  <li>run `ipconfig /all', being on a windows machine </li>
  <li>finally opened a browser in a device connected to another network and pointed it to the appropriate <strong>IP:port</strong> address</li>
  </ul>
  
  <p>The result is that "The webpage is not available". </p>
  
  <p>Has anybody encountered the same problem? Is this a router issue?</p>
  
  <p><strong>Reference Flask app</strong></p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
      return 'Hello World!'
  
  if __name__ == '__main__':
      app.run(host= '0.0.0.0', port=9000, debug=False)
  </code></pre>