Welcome to the Treehouse Community
Looking to learn something new?
invalid syntax Django
when I saved my view.py it threw an error of "invalid syntax" I'm not seeing an issue.
messages.add_message(request, message.SUCCESS, "Message sent!")
Gavin Ralston28,770 Points
def contact_form(request): form = forms.ContactForm() if request.method == 'POST': form = form.ContactForm(request.POST)
The second asignment is assigning form.ContactForm() instead of forms.ContactForm()
So I'm guessing the syntax error is there because there is no new_message method on that item.
It simply said "invalid syntax" crashed it said the invalid syntax can from line 30 the '^' was at the 'e' of messages.
It was there and a closing ) after ['name']