Browse files

Changed an example in CSRF docs to use new 'render' shortcut

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
spookylukey committed May 9, 2011
1 parent ae1866d commit 1d350a6c51848edcb24f12a1d1c1add5cd3642fe
Showing with 2 additions and 3 deletions.
  1. +2 −3 docs/ref/contrib/csrf.txt
@@ -134,14 +134,13 @@ data. (These are often the same view function, but not always). It is used like
from django.views.decorators.csrf import csrf_protect
- from django.template import RequestContext
+ from django.shortcuts import render
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

0 comments on commit 1d350a6

Please sign in to comment.