askedrelic / django-book

A revival of Django Book, the comprehensive guide to Django, overhauling it for Django 1.4 compatibility
http://django-book.readthedocs.org/en/latest/
Other
55 stars 22 forks source link

Chapter 7: Forms #12

Closed dvreed77 closed 11 years ago

dvreed77 commented 11 years ago

Running Forms examples as instructed results in csrf errors.

Needed to include {% csrf_token %} in template and

return render_to_response('contact_form.html', {'form': form},
        context_instance=RequestContext(request))

to views.py for this to work.

askedrelic commented 11 years ago

Thanks! Good point, with the latest Django, CSRF validation should come sooner in the book.