コード例 #1
0
def app(request):
    db_fd, temp_db_location = tempfile.mkstemp()
    config = {'DATABASE': temp_db_location, 'TESTING': True, 'DB_FD': db_fd}

    app = create_app(config=config)

    with app.app_context():
        init_db()
        yield app
コード例 #2
0
ファイル: test_flaskr.py プロジェクト: youkeihinn/git-test
def app(request):
    db_fd.temp_db_location = tempfile.mkstemp()
    config = {
            'DATABASE':temp_db_location,
            'TESTING':True,
            'DB_FD':db_fd
            }
    app = create_app(config=config)

    with app.app_context():
        init_db()
        yield app
コード例 #3
0
def app():
    db_fd, db_path = tempfile.mkstemp()
    config = {
        'DATABASE': db_path,
        'TESTING': True,
    }
    app = create_app(config=config)

    with app.app_context():
        init_db()
        yield app

    os.close(db_fd)
    os.unlink(db_path)
コード例 #4
0
ファイル: test_flaskr.py プロジェクト: ChengZhongShen/flask
def app():
    db_fd, db_path = tempfile.mkstemp()
    config = {
        'DATABASE': db_path,
        'TESTING': True,
    }
    app = create_app(config=config)

    with app.app_context():
        init_db()
        yield app

    os.close(db_fd)
    os.unlink(db_path)
コード例 #5
0
ファイル: app.py プロジェクト: weifei0228/flasktest
from flaskr.factory import create_app
#from flaskr.blueprints.flaskr import init_db

app=create_app()
#init_db()
with app.app_context():
	
	if __name__=="__main__":
		app.run(host='0.0.0.0', port=8080)
	
		#app.run()
	
コード例 #6
0
def create_app(settings_override=None):
    app = factory.create_app(__name__, settings_override)
    init_app(app)
    return app
コード例 #7
0
ファイル: __init__.py プロジェクト: planset/study_flask
from flaskr import factory

app = factory.create_app(__name__)
コード例 #8
0
from flaskr.factory import create_app
#from flaskr.blueprints.flaskr import init_db

app = create_app()
#init_db()
with app.app_context():

    if __name__ == "__main__":
        app.run(host='0.0.0.0', port=8080)

        #app.run()
コード例 #9
0
def create_app(settings_override=None):
    app = factory.create_app(__name__, settings_override)
    init_app(app)
    return app