Get template_name from function kwargs