Issue #25 invalid

Flask-Script should not require an app instance

Italo Maia
created an issue

It would be much better if flask-script would require a app_factory method instead of an actual app instance. Doing so, flask-script would play "better" with other extensions. Example:

{{{

!python

from flask_ext.lettuce import Harvest from flask_ext.script import Manager from flask import Flask

def app_factory(config): app = Flask(name) app.config.from_object(config)

manager = Manager(lambda: app_factory(dev_config)) manager.add_command("harvest", Harvest(lambda: app_factory(test_config)) ) manager.run()

}}}

Comments (1)

  1. Italo Maia reporter

    Invalid. Reading source code I found out this do the trick:

    manager.add_option("-c", "--config", dest="config", required=False, default=config.Dev)

  2. Log in to comment