1. Dan Jacob
  2. Flask-Script
  3. Issues
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:



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. Log in to comment