PYTHON第九十三天笔记1.1-星期一
自记录:
1、
# (UserInfo和Django中的auth.user表合成一张表)继承AbstractUser后,需要在settings文件中设置内容:
AUTH_USER_MODEL = 'app01.UserInfo'
# 否则迁移数据库时会报错:
‘’’
>python manage.py makemigrations
SystemCheckError: System check identified some issues:
ERRORS:
app01.UserInfo.groups: (fields.E304) Reverse accessor for 'UserInfo.groups' clashes with reverse accessor for 'User.group
s'.
HINT: Add or change a related_name argument to the definition for 'UserInfo.groups' or 'User.groups'.
app01.UserInfo.user_permissions: (fields.E304) Reverse accessor for 'UserInfo.user_permissions' clashes with reverse acce
ssor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'UserInfo.user_permissions' or 'User.user_permi
ssions'.
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'UserInfo.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'UserInfo.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for
'UserInfo.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'UserInfo.user_permi
ssions'.
>python manage.py migrate
‘’’
2、
# 课堂给的滑动验证码demo启动时,提示no module named “auth …..”
# 需要先安装social-auth-app-django的模块,然后可以正常启动了。(另外,django版本最好升到1.11.8或相当。)