title: Error launching Flask app with error "Failed to find Flask application"
body: <p>I'm new to <a href="https://github.com/pallets/flask" rel="noreferrer">Flask</a>. To launch the flask app, I did <code>python -m flask run</code> but I repeatedly get the error:</p>
  <blockquote>
  <p>Failed to find Flask application or factory in module &quot;app&quot;. Use &quot;FLASK_APP=app:name to specify one.</p>
  </blockquote>
  <p>I am using a <code>virtualenv</code> on a Windows 10 machine</p>
  <pre class="lang-py prettyprint-override"><code>from flask import Flask
  
  app = Flask(__name__)
  
  @app.route('/')
  def index():
      return &quot;Hello, World!&quot;
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  <p>I expected a web server to start and to be able to navigate to localhost <code>http://127.0.0.1:5000/</code> where I could view <code>Hello, World!</code> on my browser, but that never happened.</p>