0

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:

>> Role.query.all()

I get a RuntimeError:

application not registered on db instance and no application bound to current context

I have to use create the app context and do it like this:

with app.app_context():
    ...
    do stuff

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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
E Rodriguez
  • 323
  • 1
  • 2
  • 14

1 Answers1

0

I reported this issue. It was a problem with BPython https://github.com/smurfix/flask-script/pull/165

E Rodriguez
  • 323
  • 1
  • 2
  • 14