Saturday 22 June 2019

NameError at /contact_us/ name 'ContactForm' is not defined

Cause:
You didn't import ContactForm basically form in your views.py file
but, you are referring the form in views.py
form = ContactForm()

Resolution:
you have to import form in views.py
from accounts.forms import *

my ContactForm is located in accounts/forms.py

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

TypeError: argument of type 'WindowsPath' is not iterable

 Please make to modify settings.py file: DATABASES = { 'default' : { 'ENGINE' : 'django.db.backends.sqlite3&...