Given a template path, a template name and template variables
  will return rendered content using jinja2 library
  
  :param template_path: Path to template directory
  :param template_name: Name of template
  :param vars: (Optional) Template variables

def render(template_name, template_vars={}, template_set='site', template_theme=None, template_extension='html', template_content=None):
  """Given a template path, a template name and template variables
  will return rendered content using jinja2 library
  
  :param template_path: Path to template directory
  :param template_name: Name of template
  :param vars: (Optional) Template variables
  """
  global _jinja_env
  
  if not _jinja_env:
    raise 'Jinja env not setup'

  try:
    _jinja_env.filters['timesince'] = timesince
    _jinja_env.filters['timeuntil'] = timeuntil
    _jinja_env.filters['date'] = date_format
    _jinja_env.filters['time'] = time_format
    _jinja_env.filters['shortdate'] = short_date
    _jinja_env.filters['isodate'] = iso_date
    _jinja_env.filters['rfcdate'] = rfc2822_date
    _jinja_env.filters['tformat'] = datetimeformat
    _jinja_env.filters['timestamp'] = timestamp
  except NameError as errstr:
    logging.info('Helper import error: %s' % errstr)

  _template_name = "%s.%s" % (template_name, template_extension)
  template = _jinja_env.get_template(_template_name, parent=template_theme)
  
  return template.render(template_vars)