Opened 14 years ago

Closed 14 years ago

#12770 closed (invalid)

Docs 1.1: Update tuto3 and tuto4 by including RequestContext and csrf_token

Reported by: dsnoeck Owned by: nobody
Component: Documentation Version: 1.1
Severity: Keywords: RequestContext
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In the chapter "Raising 404" of the tutorial 3, the code need to be updated with the RequestContext() (Only for dev doc)

def detail(request, poll_id):
    p = get_object_or_404(Poll, pk=poll_id)
    return render_to_response('polls/detail.html', {'poll': p}, context_instance=RequestContext(request))

And the chapter "Write a simple form" of tutorial 4, need to update the code of the detail view as well by adding {% csrf_token %} in the form

-- Damien

Change History (1)

comment:1 Changed 14 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

Neither of these changes are necessary. The demo does not require a request context at the point indicated, and Django 1.1 doesn't require {% csrf_token %} at all. In fact, given that we haven't made a formal release that includes the {% csrf_token %} compatibility implementation, putting {% csrf_token %} in the v1.1 docs can only serve to confuse.

Note: See TracTickets for help on using tickets.
Back to Top