smurfix/flask-script

Sub-manager default tasks run using parent.app

emosbaugh opened this issue · 1 comments

the example in the readme does not work for me. when i call python manage.py runserver it starts the parent app (MyApp) rather than the sub-manager app (MyAdminApp).

def gen_admin(app, **kwargs):
    from myweb.admin import MyAdminApp
    ## easiest but possibly incomplete way to copy your settings
    return MyAdminApp(config=app.config, **kwargs)
sub_manager = Manager(gen_admin)

manager = Manager(MyApp)
manager.add_command("admin", sub_manager)

added a pull request. closing