new_contents: # Adapted from https://gist.github.com/mnazim/1073637
  from django import template
  from django.core.urlresolvers import reverse
  
  register = template.Library()
  
  @register.simple_tag
  def active_class(request_path, name, **kwargs):
      """ Return the string ' active ' current request.path is same as name
  
      Keyword aruguments:
      request  -- Django request object
      name     -- name of the url
      kwargs   -- any kwargs that this route needs
      """
      path = reverse(name, kwargs=kwargs)
  
      if request_path == path:
          return ' active '
  
      return ''
  
subject: Add active_class template tag