def init(): # connect to database db.init(**POSTGRES) db.connect() # set up logging logging.basicConfig( filename=log_file_path, level=log_level, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" )
def __init__(self): settings = get_project_settings() log.msg("Connecting to database {0}...".format(settings["POSTGRES"]["database"])) db.init(**settings["POSTGRES"]) db.connect()