我的应用目录是这样的
users(app name)
|__models
|__users.py
和我的users.py的用户模型如下:-
class User(BaseModel):
first_name = models.CharField(max_length=30, null=False, blank=False)
last_name = models.CharField(max_length=30, null=False, blank=False)
email_id = models.EmailField(null=False, blank=False, unique=True)
username = models.CharField(max_length=20, null=False, blank=False, unique=True)
password = models.CharField(max_length=20, null=False, blank=False)
class Meta:
app_label = 'users'
我正在尝试将我的settigns.py中的AUTH_USER_MODEL设置为
AUTH_USER_MODEL = 'users.User'
但是我收到此错误
django.core.exceptions.ImproperlyConfigured:AUTH_USER_MODEL指的是 尚未安装的模型'users.User'
这是我的install_apps:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'oauth2_provider',
'users',
]
我该如何解决?