def filter_ensuretrailingslash(host):
    """
    Adds a trailing slash to URLs (or anything, really) if one isn't present
    Usage: {{ 'www.example.com' | ensuretrailingslash }}
    Output: 'www.example.com/'
    """
    if not host.endswith("/"):
        host = host + "/"
    return host