Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added django.views.generic.simple.direct_to_template which renders a …

…given template along with any other params from the URL pattern.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2c61aff commit dcb5bc32e0a475a514d3fdec8699c5fbe564b7ee @jacobian jacobian committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 django/views/generic/
9 django/views/generic/
@@ -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))

0 comments on commit dcb5bc3

Please sign in to comment.
Something went wrong with that request. Please try again.