美文网首页
Django_报错 admin.E408 admin.E409

Django_报错 admin.E408 admin.E409

作者: 古佛青灯度流年 | 来源:发表于2020-09-12 21:32 被阅读0次

    错误详情:

    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_报错 admin.E408 admin.E409

          本文链接:https://www.haomeiwen.com/subject/rergektx.html