From 1d350a6c51848edcb24f12a1d1c1add5cd3642fe Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 9 May 2011 18:27:28 +0000 Subject: [PATCH] Changed an example in CSRF docs to use new 'render' shortcut git-svn-id: http://code.djangoproject.com/svn/django/trunk@16186 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/contrib/csrf.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/ref/contrib/csrf.txt b/docs/ref/contrib/csrf.txt index 0be9ebe82d1..8ff77e31235 100644 --- a/docs/ref/contrib/csrf.txt +++ b/docs/ref/contrib/csrf.txt @@ -134,14 +134,13 @@ data. (These are often the same view function, but not always). It is used like this:: from django.views.decorators.csrf import csrf_protect - from django.template import RequestContext + from django.shortcuts import render @csrf_protect def my_view(request): c = {} # ... - return render_to_response("a_template.html", c, - context_instance=RequestContext(request)) + return render(request, "a_template.html", c) Use of the decorator is **not recommended** by itself, since if you forget to use it, you will have a security hole. The 'belt and braces' strategy of using