title: Flask import not registering route
body: <pre><code>flask-app 
   |_  app.py
   |_  views.py
   |_  models.py
   |_  resources.py
  </code></pre>
  
  <p>~ app.py</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  import views, models, resources
  
  
  if __name__ == '__main__':
     app.run(debug=True)
  </code></pre>
  
  <p>~ views.py</p>
  
  <pre><code>from app import app
  
  @app.route('/')
  def index():
      home = "&lt;h1&gt;Welcome&lt;/h1&gt;"
      return home
  </code></pre>
  
  <p>For some reason I get a 404 not found error when I try to access localhost:5000.</p>
  
  <p>Read this answer (<a href="https://stackoverflow.com/questions/14956656/cant-route-to-login-with-flask">Can&#39;t route to &quot;/login&quot; with flask?</a>) but I doubt it has anything to do with trailing slashes.</p>
  
  <p>When I paste the route back into app.py it starts working again. Why is this? How can I fix my flask app? Would appreciate any help.</p>