Don't give into the temptation to do everything on one line.

template_filename = os.path.join(self.base_dir(theme_name), 'templates', template_name)
template_file = open(template_filename, 'r')
to.content = template_file.read()