(request)
return {
        'current_url_name': url_name,
    }
Adds the name for the matched url pattern for the current request to the
    request context.
Adds the name for the matched url pattern for the current request to the
    request context.
Adds the name for the matched url pattern for the current request to the request context .
def current_url_name(request):
    """
    Adds the name for the matched url pattern for the current request to the
    request context.
    """
    try:
        match = resolve(request.path)
        url_name = match.url_name
    except Http404:
        url_name = None

    return {
        'current_url_name': url_name,
    }
def current_url_name ( request ) : try : match = resolve ( request . path ) url_name = match . url_name except Http404 : url_name = None return { 'current_url_name' : url_name , }