RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. 之前有类似的回答,不过照着做依然有这个报错。请各位大神帮帮忙!补充:发现这个错误在 from users.models import VerifyCode 时就会出现,users.models下有UserProfile、VerifyCode2个类。users.models import VerifyCode会导致错误,但是from apps.users.models import VerifyCode就无错误,sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))已添加,INSTALLED_APPS也已经设置,很奇怪。
11 回答

慕设计9479289
TA贡献3条经验 获得超0个赞
添加回答
举报
0/150
提交
取消