Ticket #7189: context_processors_in_direct_to_template.diff
File context_processors_in_direct_to_template.diff, 1.7 KB (added by , 17 years ago) |
---|
-
django/views/generic/simple.py
2 2 from django.template import loader, RequestContext 3 3 from django.http import HttpResponse, HttpResponsePermanentRedirect, HttpResponseGone 4 4 5 def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs):5 def direct_to_template(request, template, extra_context=None, mimetype=None, context_processors=None, **kwargs): 6 6 """ 7 7 Render a given template with any extra URL parameters in the context as 8 8 ``{{ params }}``. … … 14 14 dictionary[key] = value() 15 15 else: 16 16 dictionary[key] = value 17 c = RequestContext(request, dictionary )17 c = RequestContext(request, dictionary, context_processors) 18 18 t = loader.get_template(template) 19 19 return HttpResponse(t.render(c), mimetype=mimetype) 20 20 -
docs/generic_views.txt
102 102 * ``mimetype``: The MIME type to use for the resulting document. Defaults 103 103 to the value of the ``DEFAULT_CONTENT_TYPE`` setting. 104 104 105 * ``context_processors``: A list of template-context processors to apply to 106 the view's template. See the `RequestContext docs`_. 107 105 108 **Example:** 106 109 107 110 Given the following URL patterns:: … … 818 821 819 822 An example of the use of pagination can be found in the `object pagination`_ 820 823 example model. 821 824 822 825 .. _`object pagination`: ../models/pagination/ 823 826 824 827 **New in Django development version:**