Using Flask-Script shell with BPython can't get app context
<p>I am building a Flask application using app factory pattern. If I install BPython on my virtualenv, and use the shell, it seems like it cannot get the app context, and therefore when I try to do something like:</p>

<pre><code>&gt;&gt; Role.query.all()
</code></pre>

<p>I get a RuntimeError:</p>

<pre><code>application not registered on db instance and no application bound to current context
</code></pre>

<p>I have to use create the app context and do it like this:</p>

<pre><code>with app.app_context():
    ...
    do stuff
</code></pre>

<p>However, if I use IPython, it works fine. In the docs it says it's ready for both BPython and IPython so I don't know why it's not creating the app context.</p>