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__"

 

2、进入页面,提示no such table xxx,没有找到该表里,

可以进到项目目录下,删除Migrations文件夹,再执行一下 python manage.py syncdb数据库同步后,开启服务即可。

 

相关文章:

  • 2022-12-23
  • 2021-06-26
  • 2021-11-10
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-11-20
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-08-27
  • 2021-04-14
相关资源
相似解决方案