title: Flask Hello World Program Not working 404 Not Found Error
body: <p>I am trying to get started with Flask, and I get 404 Not Found error for the hello world program.</p>
  
  <p>The program I use:</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/')
  @app.route('/index.html')
  def hello_world():
      return 'Hello, World'
  
  if __name__== '__main__':
      app.run(host='localhost')
  </code></pre>
  
  <p>then I run </p>
  
  <pre><code>$export FLASK_APP = minimal.py
  $flask run
  </code></pre>
  
  <p>Which returns: </p>
  
  <pre><code>* Serving Flask app "minimal"
  * Forcing debug mode on
  * Restarting with stat
  * Debugger is active!
  * Debugger PIN 127-804-808
  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  </code></pre>
  
  <p>When I visit <a href="http://localhost:5000" rel="nofollow noreferrer">http://localhost:5000</a> or <a href="http://127.0.0.1:5000" rel="nofollow noreferrer">http://127.0.0.1:5000</a>, I get:</p>
  
  <pre><code>Not Found
  The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
  </code></pre>
  
  <p>And my host file looks like this: </p>
  
  <pre><code># localhost name resolution is handled within DNS itself.
  #   127.0.0.1       localhost
  #   ::1             localhost
  </code></pre>
  
  <p>Any idea whats wrong? Thank you</p>