title: Flask App will not load app.py (The file/path provided (app) does not appear to exist)
body: <p>My flask app is outputting 'no content' for the <code>for()</code> block and i dont know why.</p>
  
  <p>I tested my query in <code>app.py</code> , here is <code>app.py</code>:</p>
  
  <pre><code># mysql config
  app.config['MYSQL_DATABASE_USER'] = 'user'
  app.config['MYSQL_DATABASE_PASSWORD'] = 'mypass'
  app.config['MYSQL_DATABASE_DB'] = 'mydbname'
  app.config['MYSQL_DATABASE_HOST'] = 'xxx.xxx.xxx.xxx'
  mysql = MySQL()
  mysql.init_app(app)
  c = mysql.connect().cursor()
  blogposts = c.execute("SELECT post_title, post_name FROM mydbname.wp_posts WHERE post_status='publish' ORDER BY RAND() LIMIT 3")
  
  @app.route('/', methods=('GET', 'POST'))
  def email():
      form = EmailForm()
  
      if request.method == 'POST':
          if form.validate() == False:
              return 'Please fill in all fields &lt;p&gt;&lt;a href="/"&gt;Try Again&lt;/a&gt;&lt;/p&gt;'
          else:
              msg = Message("Message from your visitor",
                            sender='contact@site.com',
                            recipients=['contact@site.com'])
              msg.body = """
              From: %s
              """ % (form.email.data)
              mail.send(msg)
              #return "Successfully  sent message!"
              return render_template('email_submit_thankyou.html')
      elif request.method == 'GET':
          return render_template('index.html', blogposts)
  </code></pre>
  
  <p>This is what my <code>app.py</code> looks like.</p>
  
  <p>Below is my <code>index.html</code> in <code>templates/</code>:</p>
  
  <pre><code>    &lt;ul&gt;
          {% for blogpost in blogposts %}
          &lt;li&gt;&lt;a href="{{blogpost[1]}}"&gt;{{blogpost[0]}}&lt;/a&gt;&lt;/li&gt;
          {% else %}
          &lt;li&gt;no content...&lt;/li&gt;
          {% endfor %}
          &lt;div class="clearL"&gt; &lt;/div&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>I checked the query, and it returns desired output like:</p>
  
  <pre><code>ID   post_title       post_name
  1    a title here     a-title-here
  2    a title here2     a-title-here2
  3    a title here3     a-title-here3
  </code></pre>
  
  <p>If i try to restart the dev server by running <code>export FLASK APP=app.py', then</code>flask run`, i get an error of:</p>
  
  <pre><code>Error: The file/path provided (app) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py
  </code></pre>
  
  <p>I've also tried running via <code>export FLASK_APP=app.py</code> then <code>python -m flask run</code> - this also gives the same error.</p>
  
  <p>Thoughts on how to resolve?</p>