1. 程式人生 > >django啟動服務時報錯:RuntimeError: Model class index.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

django啟動服務時報錯:RuntimeError: Model class index.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

error: 時報 解決 install runtime .py 遇到 setting runt

在django框架中用命令啟動服務時報如下錯誤:

  RuntimeError: Model class index.models.User doesn‘t declare an explicit app_label and isn‘t in an application in INSTALLED_APPS.

解決方法:

  我是這樣解決的:

  檢查setting.py裏面的INSTALLED_APPS,發現應用沒有註冊。把應用註冊之後,重啟服務就好了

  其它解決方法,以後遇到了再補充。

django啟動服務時報錯:RuntimeError: Model class index.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.