码迷,mamicode.com
首页 > 其他好文 > 详细

(三)Django继承AbstractUser新建User Model时出现fields.E304错误

时间:2017-10-24 19:26:49      阅读:3687      评论:0      收藏:0      [点我收藏+]

标签:size   sso   django   code   ups   mode   auth   with   ash   

错误详情:

auth.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes with reverse accessor for ‘User.groups’.
HINT: Add or change a related_name argument to the definition for ‘User.groups’ or ‘User.groups’.
auth.User.user_permissions: (fields.E304) Reverse accessor for ‘User.user_permissions’ clashes with reverse accessor for ‘User.user_permissions’.
HINT: Add or change a related_name argument to the definition for ‘User.user_permissions’ or ‘User.user_permissions’.
users.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes with reverse accessor for ‘User.groups’.
HINT: Add or change a related_name argument to the definition for ‘User.groups’ or ‘User.groups’.
users.User.head_url: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command “pip install Pillow”.
users.User.user_permissions: (fields.E304) Reverse accessor for ‘User.user_permissions’ clashes with reverse accessor for ‘User.user_permissions’.
HINT: Add or change a related_name argument to the definition for ‘User.user_permissions’ or ‘User.user_permissions’.

解决方案:

需要在setting中重载AUTH_USER_MODEL

AUTH_USER_MODEL = users.UserProfile

users:你的app

UserProfile:model

(三)Django继承AbstractUser新建User Model时出现fields.E304错误

标签:size   sso   django   code   ups   mode   auth   with   ash   

原文地址:http://www.cnblogs.com/bbbbbd/p/7725030.html

(1)
(2)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!