django.core.exceptions.FieldError: Unknown field(s) (body ) specified for Comment
You need to remove a white space at the end of 'body '
field, where you should have 'body'
like below:
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('name', 'email', 'body')
The same error also occurs if a model field with editable=False
is included in a form's fields. Removing the editable
attribute on the model field fixes the error.