def METHOD_NAME(database_name=''):
    database_name = database_name or settings.DATABASE_NAME
    try:
        import psycopg2
        conn = psycopg2.connect(database=database_name)
    except Exception as exc:
        logger.error(f'Error connecting to postgres database: {exc}')
        conn = sqlite3.connect(database_name)
    return conn