Beispiel #1
0
#!/usr/bin/env python

import logging
from logging.config import dictConfig
from werkzeug.contrib.profiler import ProfilerMiddleware

# Environment must be set before importing the app factory function.
import lakesuperior.env_setup

from lakesuperior.config_parser import config
from lakesuperior.globals import AppGlobals
from lakesuperior.env import env

options = {
    'restrictions': [30],
    #'profile_dir': '/tmp/lsup_profiling'
}

from lakesuperior.app import create_app

if __name__ == '__main__':
    fcrepo = create_app(config['application'])
    fcrepo.wsgi_app = ProfilerMiddleware(fcrepo.wsgi_app, **options)
    fcrepo.config['PROFILE'] = True
    fcrepo.run(debug=True)
Beispiel #2
0
def app():
    app = create_app(env.app_globals.config['application'])

    yield app
Beispiel #3
0
def run():
    fcrepo = create_app(config['application'])
    fcrepo.wsgi_app = ProfilerMiddleware(fcrepo.wsgi_app, **options)
    fcrepo.config['PROFILE'] = True
    fcrepo.run(debug = True)
Beispiel #4
0
def app():
    app = create_app(env.config['application'])

    yield app
Beispiel #5
0
import logging

from logging.config import dictConfig

# Environment must be set before importing the app factory function.
import lakesuperior.env_setup

from lakesuperior import env
from lakesuperior.config_parser import config
from lakesuperior.globals import AppGlobals

from lakesuperior.app import create_app

dictConfig(env.app_globals.config['logging'])
logger = logging.getLogger(__name__)

# this stays at the module level so it's used by GUnicorn.
fcrepo = create_app(env.app_globals.config['application'])

def run():
    fcrepo.run(host='0.0.0.0')

if __name__ == "__main__":
    run()