コード例 #1
0
def app(request):
    app = create_app(REDIS_URL="redis://localhost/9")
    app_context = app.test_request_context()
    app_context.push()
    return app
コード例 #2
0
ファイル: env.py プロジェクト: thoas/freight
# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
from flask import current_app
from freight.config import create_app, db

import warnings
from sqlalchemy.exc import SAWarning
warnings.simplefilter("ignore", SAWarning)

if not current_app:
    app = create_app()
else:
    app = current_app
app.app_context().push()
target_metadata = db.metadata

# force registration of models
import freight.models  # NOQA


def run_migrations():
    """Run migrations in 'online' mode.

    In this scenario we need to create an Engine
    and associate a connection with the context.
コード例 #3
0
ファイル: conftest.py プロジェクト: nicolasbaer/freight
def app(request):
    app = create_app()
    app_context = app.test_request_context()
    app_context.push()
    return app
コード例 #4
0
ファイル: conftest.py プロジェクト: nickbruun/freight
def app(request):
    app = create_app()
    app_context = app.test_request_context()
    app_context.push()
    return app
コード例 #5
0
ファイル: conftest.py プロジェクト: 2doi/freight
def app(request):
    app = create_app(REDIS_URL='redis://localhost/9')
    app_context = app.test_request_context()
    app_context.push()
    return app