def create_app(self): self.app = create_flask_app('testing') self.client = self.app.test_client() self.app_context = self.app.app_context() self.app_context.push() return self.app
import os from flask_script import Manager from flask_migrate import MigrateCommand from main import create_flask_app environment = os.getenv("FLASK_CONFIG") app = create_flask_app(environment) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
from main import create_flask_app from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bcrypt import Bcrypt db = SQLAlchemy() flask_bcrypt = Bcrypt() args = {'db':db, 'bcrypt':flask_bcrypt} app = create_flask_app(**args)