Example #1
0
def app(request):
    app = create_app(REDIS_URL="redis://localhost/9")
    app_context = app.test_request_context()
    app_context.push()
    return app
Example #2
0
File: env.py Project: 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.
Example #3
0
def app(request):
    app = create_app()
    app_context = app.test_request_context()
    app_context.push()
    return app
Example #4
0
def app(request):
    app = create_app()
    app_context = app.test_request_context()
    app_context.push()
    return app
Example #5
0
def app(request):
    app = create_app(REDIS_URL='redis://localhost/9')
    app_context = app.test_request_context()
    app_context.push()
    return app