title: Binding routes when using an app factory
body: <p>How are routes suppose to be handled in flask when using an app factory? Given a package <code>blog</code> that contains everything needed for the app and a management script that creates the app then how are you suppose to reference the app in the routes?  </p>
  
  <pre><code>├── blog
      ├── manage.py 
      └── blog
          ├── __init__.py
          ├── config.py  
          └── routes.py
  </code></pre>
  
  <p><strong>manage.py</strong></p>
  
  <pre><code>#!/usr/bin/env python
  
  from flask.ext.script import Manager
  
  manager = Manager(create_app)
  
  # &lt;manager commands&gt;
  # ...
  # ...
  
  manager.add_option('-c', '--config', dest='config', required=False)
  manager.run()
  </code></pre>
  
  <p><strong>blog/__init__.py</strong></p>
  
  <pre><code>from flask import flask
  from .config import Default
  
  def create_app(config=None):
  
      app = Flask(__name__)
      app.config.from_object(Default)
  
      if config is not None:
          app.config.from_pyfile(config)
  
      return app
  </code></pre>
  
  <p><strong>blog/routes.py</strong></p>
  
  <pre><code>@app.route()  # &lt;-- erm, this won't work now!? 
  def index():
       return "Hello"
  </code></pre>
  
  <p>The problem is the app is created outside the package so how are the routes suppose to be handled with a setup like this?</p>