天天看點

django搭建Bootstrap常用問題解決方法

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資料庫同步後,開啟服務即可。

技術改變世界!

--狂詩絕劍