@register.filter
def date(value, arg=None):
    if not value:
        return u''
    if arg is None:
        arg = settings.DATE_FORMAT
    try:
        return formats.date_format(value, arg)
    except AttributeError:
        try:
            return format(value, arg)
        except AttributeError:
            return ''
Formats a date according to the given format.
dataset/ETHPy150Open crate-archive/crate-site/crateweb/apps/core/helpers.py/date