title: Access flask application context from within greenlet
body: <p>I have a flask-script command that spawns a long sequence of greenlets. The problem is, these greenlets are unable to access my app context. I get a 
  "> failed with RuntimeError" at all times (accessing app.logger, per example). Suggestions? </p>
  
  <p>On of my attempts:
      spawn(method, app, arg1, arg2)</p>
  
  <pre><code>def spawn(app, arg1, arg2):
      with app.app_context():
          app.logger.debug('bla bla') # doesn't work
          ... do stuff
  </code></pre>