diff --git a/docs/ref/contrib/csrf.txt b/docs/ref/contrib/csrf.txt index 0be9ebe82d..8ff77e3123 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