Issue #29 seems to be solved. But why do I have to set app.app_context() whenever a db query is performed outside a direct view function.
Refer issue for details.