示例#1
0
    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
示例#2
0
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()
示例#3
0
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)