Skip to content

Commit

Permalink
Changed an example in CSRF docs to use new 'render' shortcut
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed May 9, 2011
1 parent ae1866d commit 1d350a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/ref/contrib/csrf.txt
Expand Up @@ -134,14 +134,13 @@ data. (These are often the same view function, but not always). It is used like
this:: this::


from django.views.decorators.csrf import csrf_protect from django.views.decorators.csrf import csrf_protect
from django.template import RequestContext from django.shortcuts import render


@csrf_protect @csrf_protect
def my_view(request): def my_view(request):
c = {} c = {}
# ... # ...
return render_to_response("a_template.html", c, return render(request, "a_template.html", c)
context_instance=RequestContext(request))


Use of the decorator is **not recommended** by itself, since if you forget to 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 use it, you will have a security hole. The 'belt and braces' strategy of using
Expand Down

0 comments on commit 1d350a6

Please sign in to comment.