1、进入页面,提示Creating a ModelForm without either the ‘fields‘ attribute or the ‘exclude‘时
解决方法:打开forms.py文件,修改如下:
class TestModelForm(forms.ModelForm):
class Meta:
model = User
#model = Author
fields = "__all__"
时间: 2024-11-09 09:50:41