diff options
| author | Silvan Spross <silvan.spross@gmail.com> | 2013-05-18 14:00:52 +0200 |
|---|---|---|
| committer | Marc Egli <frog32@me.com> | 2013-05-18 18:39:11 +0200 |
| commit | cd72c55d8603751af40a55d2d18f264827fa0744 (patch) | |
| tree | 10d1571c17b7b15cf5ecde6db741a7a52bc7f85a /docs/ref/template-response.txt | |
| parent | e4591debd19361e628317e936ed8123d9897dd6a (diff) | |
Add missing imports and models to the examples in the view layer documentation
Diffstat (limited to 'docs/ref/template-response.txt')
| -rw-r--r-- | docs/ref/template-response.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/ref/template-response.txt b/docs/ref/template-response.txt index cdefe2fae8..4f34d150ed 100644 --- a/docs/ref/template-response.txt +++ b/docs/ref/template-response.txt @@ -215,6 +215,7 @@ re-rendered, you can re-evaluate the rendered content, and assign the content of the response manually:: # Set up a rendered TemplateResponse + >>> from django.template.response import TemplateResponse >>> t = TemplateResponse(request, 'original.html', {}) >>> t.render() >>> print(t.content) @@ -256,6 +257,8 @@ To define a post-render callback, just define a function that takes a single argument -- response -- and register that function with the template response:: + from django.template.response import TemplateResponse + def my_render_callback(response): # Do content-sensitive processing do_post_processing() |
