title: python flask 404 not found
body: <p>I am new to flask development, and can't the following application work. I wish to declare the Flask app in run.py, and import it in the other packages such as myapp below. I design it this way is because there are more than one independent applications/packages. I get 404 when trying to access the url ".../hello". Where am I wrong? Thanks!</p>
  
  <p>The project layout is look like this:</p>
  
  <pre><code>├── myapp
  │   ├── __init__.py
  │   └── myapp.py
  └── run.py
  </code></pre>
  
  <p>myapp/__init__.py contains:</p>
  
  <pre><code>from flask import Flask
  my_app = Flask(__name__)
  from . import myapp
  </code></pre>
  
  <p>myapp/myapp.py contains:</p>
  
  <pre><code>from run import app
  @app.route('/hello')
  def show_conf2():
      return "Hello, world!"
  </code></pre>
  
  <p>The run.py contains:</p>
  
  <pre><code>from flask import Flask
  from gevent.pywsgi import WSGIServer
  import myapp
  @app.route('/')
  def index():
      return 'Home route.'
  app = Flask(__name__)
  http_server = WSGIServer(('', 5000), app)
  http_server.serve_forever()
  </code></pre>