def init_context(): return dict(app=app) manager.add_command('shell',Shell(make_context=init_context))