Error 我在forms.py中编写了以下代码。我无法理解这有什么问题。这会产生无效的语法
form django import forms
class contactForm(forms.Forms):
name=forms.CharField(required=False,max_length=100,help_text='100 characters max.')
email=forms.EmailField(required=True)
comment=forms.CharField(required=True,widget=forms.Textarea)
答案 0 :(得分:1)
检查拼写错误:您需要forms.Form
而不 forms.Forms
。
class contactForm(forms.Form):
错误:写from
而不是form
from django import forms
^^^^