def user_exists(cursor,username):
    """
    Test whether a user exists, from its username
    Parameters:
    ==========
    cursor: Psycopg2 cursor
        Cursor of type RealDict in the postgres database
    username: Str
        Name of the user
    """
    SQL = "SELECT count(*) AS nb FROM users WHERE username=%s"
    cursor.execute(SQL,[username])
    res = bool(cursor.fetchone()['nb'])
    return(res)