def generate_template(template_name, **context):
 context.update(href=href, format_datetime=format_datetime)
 return template_loader.load(template_name).generate(**context)

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