from datetime import datetime


def readable_date_filter(dt, f="%d %B %Y"):
    """
    Takes a datetime and returns a readable date

    Optional format
    """
    if isinstance(dt, datetime):
        return dt.strftime(f)
    return dt