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: http://code.djangoproject.com/svn/django/trunk@1247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2005-11-15 16:55:26 +00:00
parent 2c61aff523
commit dcb5bc32e0
1 changed files with 9 additions and 0 deletions

View File

@ -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))