mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
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
This commit is contained in:
parent
ae1866ddef
commit
1d350a6c51
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user