apps/home/templatetags/nav_active.py
def nav_active(request, pattern):
    """
    Tag to mark navigation with active tag
    :param request: WSGIRequest
    :param pattern: String
    :return: String
    """
    try:
        if re.search(pattern, request.path):
            return 'active'
        return ''
    except Exception:
        # @TODO: log exception
        return ''

    Tag to mark navigation with active tag
    :param request: WSGIRequest
    :param pattern: String
    :return: String
    
Tag to mark navigation with active tag
Tag to mark navigation with active tag
def nav_active(request, pattern):
    try:
        if re.search(pattern, request.path):
            return 'active'
        return ''
    except Exception:
        return ''
def nav_active ( request , pattern ) : try : if re . search ( pattern , request . path ) : return 'active' return '' except Exception : return ''
Tag to mark navigation with active tag
Tag to mark navigation with active tag
"""
    Tag to mark navigation with active tag
    :param request: WSGIRequest
    :param pattern: String
    :return: String
    """ # @TODO: log exception
None
request
None
pattern
None