summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/templates.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt
index 8cae601979..fb64f20c6e 100644
--- a/docs/topics/templates.txt
+++ b/docs/topics/templates.txt
@@ -309,6 +309,11 @@ templates, Django provides a shortcut function which automates the process.
The ``request`` argument was added.
+ Usage example::
+
+ from django.template.loader import render_to_string
+ rendered = render_to_string('my_template.html', {'foo': 'bar'})
+
See also the :func:`~django.shortcuts.render()` shortcut which calls
:func:`render_to_string()` and feeds the result into an
:class:`~django.http.HttpResponse` suitable for returning from a view.