django 配置不正确AUTH_USER_MODEL引用了尚未安装模型'core.User'

3bygqnnd  于 2022-12-05  发布在  Go
关注(0)|答案(1)|浏览(99)

我在我的核心应用- www.example.com中调用此方法models.py,

from django.contrib.auth import get_user_model
User = get_user_model()

出现错误,

Exception has occurred: ImproperlyConfigured (note: full exception trace is shown but execution is paused at: <module>)
AUTH_USER_MODEL refers to model 'core.User' that has not been installed

调试器指向此行

hc2pp10m

hc2pp10m1#

我发现了问题,

User = get_user_model()

我在core appmodels.py中粘贴了以下代码

相关问题