<s> from gevent import monkey <EOL> monkey . patch_all ( ) <EOL> from flask_bootstrap import Bootstrap <EOL> from flask . ext . sqlalchemy import SQLAlchemy <EOL> from flask import Flask <EOL> from flask . ext . login import LoginManager <EOL> from flask . ext . socketio import SocketIO <EOL> import logging <EOL> import os <EOL> from logentries import LogentriesHandler <EOL> def setup_logging ( loggers_and_levels , logentries_id = None ) : <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> log . setLevel ( logging . INFO ) <EOL> if logentries_id : <EOL> logentries_handler = LogentriesHandler ( logentries_id ) <EOL> handler = logentries_handler <EOL> else : <EOL> handler = logging . StreamHandler ( ) <EOL> FORMAT = "<STR_LIT>" <EOL> formatter = logging . Formatter ( fmt = FORMAT ) <EOL> handler . setFormatter ( formatter ) <EOL> log . addHandler ( handler ) <EOL> for logger , level in loggers_and_levels : <EOL> logger . setLevel ( level ) <EOL> logger . addHandler ( handler ) <EOL> def create_app ( ) : <EOL> app = Flask ( __name__ ) <EOL> app . secret_key = os . environ [ '<STR_LIT>' ] <EOL> app . config [ '<STR_LIT>' ] = os . environ [ '<STR_LIT>' ] <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = True if os . environ . get ( '<STR_LIT>' , '<STR_LIT:True>' ) == '<STR_LIT:True>' else False <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT:127.0.0.1>' ) <EOL> app . config [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> app . config [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> app . config [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> Bootstrap ( app ) <EOL> loggers_and_levels = [ ( app . logger , logging . INFO ) , <EOL> ( logging . getLogger ( '<STR_LIT>' ) , logging . WARNING ) , <EOL> ( logging . getLogger ( '<STR_LIT>' ) , logging . INFO ) ] <EOL> setup_logging ( loggers_and_levels , logentries_id = os . environ . get ( '<STR_LIT>' , None ) ) <EOL> app . logger . info ( "<STR_LIT>" ) <EOL> return app <EOL> app = create_app ( ) <EOL> db = SQLAlchemy ( app ) <EOL> login_manager = LoginManager ( app ) <EOL> socketio = SocketIO ( app ) <EOL> import wpc . views <EOL> import wpc . api </s>
