diff --git a/django/views/generic/simple.py b/django/views/generic/simple.py new file mode 100644 index 0000000000..4dffd69a47 --- /dev/null +++ b/django/views/generic/simple.py @@ -0,0 +1,9 @@ +from django.core import template_loader +from django.core.extensions import DjangoContext +from django.utils.httpwrappers import HttpResponse + +def direct_to_template(request, template, **kwargs): + """Render a given template with any extra parameters in the context.""" + t = template_loader.get_template(template) + c = DjangoContext(request, {'params' : kwargs}) + return HttpResponse(t.render(c)) \ No newline at end of file