You defined
the form variable in this if request.method == 'POST': block. If you access the view
with a GET request form gets
not defined.
Cause:
def
contact_us(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if
form.is_valid():
Resolution:
def
contact_us(request):
form = ContactForm(request.POST)
if request.method == 'POST':
if
form.is_valid():
No comments:
Post a Comment
Note: only a member of this blog may post a comment.