Django RuntimeError: Model class app_anme.models.Ad doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.报错

Error content

RuntimeError: Model class app_anme.models.Ad doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

The reason is because you are being given the reference content is not clear enough, have the same name as keys, such as a folder, the same model name, etc.

Solution: The reference path using an absolute path

from app_name.models import *

 

Guess you like

Origin www.cnblogs.com/dyd520/p/11598270.html