from app import create_app from app import lib import logging import logging.config import os logconffile = os.path.join('app/logging', '%s.ini' % os.environ.get('FLASK_ENV', 'development')) logging.config.fileConfig(logconffile, disable_existing_loggers=True) log = logging.getLogger(__name__) app = create_app() log.debug(f"Running in web mode: {lib.webMode()}") @app.shell_context_processor def get_context(): # flask cli context setup """Objects exposed here will be automatically available from the shell.""" return dict(app=app, models=models) if __name__ == '__main__': log.info("direct run") app.run()