Permalink
Browse files

Update chapter07.rst

For the example to work, you have to use {% csrf_token %} and additional imports in views.py
  • Loading branch information...
1 parent 8b4a275 commit 26d38a44b8cc477962cc8bbebc564aed44ba195e @Lapin-Blanc Lapin-Blanc committed with unknown Nov 21, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 chapter07.rst
View
3 chapter07.rst
@@ -959,6 +959,8 @@ Here's how we can rewrite ``contact()`` to use the forms framework::
from django.shortcuts import render
from mysite.contact.forms import ContactForm
+ from django.http import HttpResponseRedirect
+ from django.core.mail import send_mail
def contact(request):
if request.method == 'POST':
@@ -995,6 +997,7 @@ Here's how we can rewrite ``contact()`` to use the forms framework::
<table>
{{ form.as_table }}
</table>
+ {% csrf_token %}
<input type="submit" value="Submit">
</form>
</body>

0 comments on commit 26d38a4

Please sign in to comment.