code: def generate_template(template_name, **context):
      
      context.update(href=href, format_datetime=format_datetime)
      return template_loader.load(template_name).generate(**context)
docs: Load and generate a template.