rduplain/flask-script — Issue #25: Flask-Script should not require an app instance
Author: rduplain
Created: 2012-02-29 16:06:46+00:00
State: open
Labels: bug, import

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()

---------------------------------------
- Bitbucket: https://bitbucket.org/danjac/flask-script/issue/25
- Originally Reported By: [Italo Maia](http://bitbucket.org/italomaia)
- Originally Created At: 2011-10-30 15:26:59