Ticket #4756: 4756.patch
File 4756.patch, 1.4 KB (added by , 17 years ago) |
---|
-
docs/templates_python.txt
315 315 'foo': 'bar', 316 316 }, [ip_address_processor]) 317 317 318 Note: :318 Note: 319 319 If you're using Django's ``render_to_response()`` shortcut to populate a 320 320 template with the contents of a dictionary, your template will be passed a 321 321 ``Context`` instance by default (not a ``RequestContext``). To use a … … 329 329 my_data_dictionary, 330 330 context_instance=RequestContext(request)) 331 331 332 Or alternately, use the `simple generic view`_ ``direct_to_template()`` as a 333 shortcut. It works similar to ``render_to_response()`` except it takes 334 ``request`` as it's first argument and passes a ``RequestContext`` instance 335 to the template:: 336 337 def some_view(request): 338 # ... 339 return direct_to_template(request, 340 'my_template.html', 341 my_data_dictionary) 342 343 .. _simple generic view: ../generic_views/#django-views-generic-simple-direct-to-template 344 332 345 Here's what each of the default processors does: 333 346 334 347 .. _HttpRequest object: ../request_response/#httprequest-objects