| 1 | from . import Template |
| 2 | |
| 3 | |
| 4 | def render(template_file, **kwargs): |
| 5 | ''' |
| 6 | Cheetah.Django.render() takes the template filename |
| 7 | (the filename should be a file in your Django |
| 8 | TEMPLATE_DIRS) |
| 9 | |
| 10 | Any additional keyword arguments are passed into the |
| 11 | template are propogated into the template's searchList |
| 12 | ''' |
| 13 | import django.http |
| 14 | import django.template.loader |
| 15 | source, loader = django.template.loader.find_template_source(template_file) |
| 16 | t = Template.Template(source, searchList=[kwargs]) |
| 17 | return django.http.HttpResponse(t.__str__()) |