如何更改用户的默认模型?
from django.contrib.auth.models import User
答案 0 :(得分:2)
默认设置路径 django.conf.global_settings
global_settings.py 文件:
https://github.com/django/django/blob/master/django/conf/global_settings.py#L508
所以 settings.py 添加代码行
AUTH_USER_MODEL = 'myuserapp.MyUser'
创建MyUser模型。