其他分享
首页 > 其他分享> > pythoBUG:(fields.E304) Reverse accessor for 'UserProfile.groups' clashes with reverse acce

pythoBUG:(fields.E304) Reverse accessor for 'UserProfile.groups' clashes with reverse acce

作者:互联网

SystemCheckError: System check identified some issues:

ERRORS:
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_permissions'.
blog.UserInfo.groups: (fields.E304) Reverse accessor for 'UserInfo.groups' clashes with reverse accessor for 'User.groups'.
        HINT: Add or change a related_name argument to the definition for 'UserInfo.groups' or 'User.groups'.
blog.UserInfo.user_permissions: (fields.E304) Reverse accessor for 'UserInfo.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
        HINT: Add or change a related_name argument to the definition for 'UserInfo.user_permissions' or 'User.user_permissions'.

这是由于UserProfile扩展了内置的auth_user表,没有进行配置使用新定义的UserProfile表来做用户认证造成的异常

解决办法:
在settings.py中,添加使用UserProfile的配置选项:
AUTH_USER_MODEL = “app名.扩展表的表明”

标签:reverse,UserInfo,User,groups,permissions,accessor,user
来源: https://blog.csdn.net/qq_27695659/article/details/86678741