title: Flask running on a VM not reachable from outside
body: <p>I have a strange Flask issue. I have a simple app running on port 5000 which is running on a VM. I have a <code>config.py</code> file which is setting the listening port and IP. This is my config: </p>
  
  <pre><code>class BaseConfig(object):
      DEBUG = False
      TESTING = False
      SECRET_KEY = 'my_secret_key_which_is_not_so_secret'
      SERVER_NAME = '0.0.0.0:5000'
  
  class DevConfig(BaseConfig):
      DEBUG = True
      TESTING = True
  
  class TestConfig(BaseConfig):
      DEBUG = False
      TESTING = True
  </code></pre>
  
  <p>And I have also included the following line in my <code>__init__.py</code> file: <code>app.config.from_object('config.DevConfig')</code>. When I start the app, this is the log:</p>
  
  <pre><code>$ python app.py
   * Serving Flask app "webapp" (lazy loading)
   * Environment: production
     WARNING: Do not use the development server in a production environment.
     Use a production WSGI server instead.
   * Debug mode: on
   * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
   * Restarting with stat
   * Debugger is active!
   * Debugger PIN: XXX-XXX-XXX
  /home/ubuntu/programming/lib/python3.6/site-packages/flask/sessions.py:217: UserWarning: The session cookie domain is an IP address. This may not work as intended in some browsers. Add an entry to your hosts file, for example "localhost.localdomain", and use that instead.
    'The session cookie domain is an IP address. This may not work'
  my.ip.add.ress - - [04/Dec/2018 10:09:16] "GET / HTTP/1.1" 404 -
  my.ip.add.ress - - [04/Dec/2018 10:09:17] "GET /favicon.ico HTTP/1.1" 404 -
  127.0.0.1 - - [04/Dec/2018 10:15:31] "GET / HTTP/1.1" 404 -
  127.0.0.1 - - [04/Dec/2018 10:16:28] "GET /netemulator HTTerror 404 -
  </code></pre>
  
  <p>So when I try to reach it from my PC, I get 404 errror, the same error I got when I try to internally reach it with <code>elinks</code>. If I delete the <code>SERVER_NAME</code> line in the <code>config.py</code> I can reach it from within the VM using <code>elinks</code> and I can see that it is properly loading but I can't reach it from my PC. </p>
  
  <pre><code>$ python app.py
   * Serving Flask app "webapp" (lazy loading)
   * Environment: production
     WARNING: Do not use the development server in a production environment.
     Use a production WSGI server instead.
   * Debug mode: on
   * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
   * Restarting with stat
   * Debugger is active!
   * Debugger PIN: XXX-XXX-XXX
  127.0.0.1 - - [04/Dec/2018 10:18:34] "GET / HTTP/1.1" 200 -
  127.0.0.1 - - [04/Dec/2018 10:18:36] "GET /netemulator HTTP/1.1" 200 -
  </code></pre>