创建数据库models.py,在进行数据迁移时抛出一下异常:

E:\Project\GuoJia>python manage.py makemigrations
SystemCheckError: System check identified some issues: ERRORS:
Fenxiao.UserProfile.groups: (fields.E304) Reverse accessor for 'UserProfile.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'UserProfile.groups' or 'User.groups'.
Fenxiao.UserProfile.user_permissions: (fields.E304) Reverse accessor for 'UserProfile.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'UserProfile.user_permissions' or 'User.user_permissions'.
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'UserProfile.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'UserProfile.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'UserProfile.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'UserProfile.user_permissions'.

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

解决办法:

在settings.py中,添加使用UserProfile的配置选项:

AUTH_USER_MODEL = "app名.扩展表的表明"

(fields.E304) Reverse accessor for 'UserProfile.groups' clashes with reverse accessor for 'User.groups'.的更多相关文章

  1. SystemCheckError: System check identified some issues: ERRORS: users.Test.groups: (fields.E304) Reverse accessor for 'Test.groups' clashes with reverse accessor for 'User.groups'.

    Error Msg: SystemCheckError: System check identified some issues: ERRORS: users.Test.groups: (fields ...

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

    错误内容如下 ERRORS: audit.UserProfile.groups: (fields.E304) Reverse accessor for 'UserProfile.groups' cla ...

  3. auth.User.groups: (fields.E304)

    配置用户信息的models时,如果继承Abstractuser类时,报错: ERRORS:auth.User.groups: (fields.E304) Reverse accessor for 'U ...

  4. 【转】Django继承AbstractUser新建User Model时出现auth.User.groups: (fields.E304)错误

    错误详情如下: (venv) D:\workspace\music>python manage.py makemigrations SystemCheckError: System check ...

  5. Django继承AbstractUser新建UserInfor Model时出现fields.E304错误

    错误详情: SystemCheckError: System check identified some issues: ERRORS:app01.UserInfo.groups: (fields.E ...

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

    错误详情: auth.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes with reverse access ...

  7. django --fields.E304 错误解决方案

    今天在同一个表里,有多个不同的用户集时出现. fields.E304: Field name <field name> clashes with accessor for <fiel ...

  8. django继承修改 User表导致的问题 fields.E304(permissions/group都会有这样的错误)

    问题: django继承修改 User表时,进行migrations操作时会导致的问题 fields.E304(permissions/group都会有这样的错误)如图: 根源: django文档中有 ...

  9. LeetCode: Reverse Words in a String:Evaluate Reverse Polish Notation

    LeetCode: Reverse Words in a String:Evaluate Reverse Polish Notation Evaluate the value of an arithm ...

随机推荐

  1. UEditor如何读取数据库信息?

    你用的什么语言,服务器端生成的时候,直接写在里面就可以了啊,比如 <textarea name="content" cols="800" rows=&qu ...

  2. Vue学习之路第十九篇:按键修饰符的使用

    1.我们工作中经常会有类似于这样的需求:按下Enter键触发某个事件.或者按下ESC退出页面等各种各样的场景.在Vue中,可以通过键盘修饰符来实现这样的场景. 2.事例代码: <body> ...

  3. [luogu1463 HAOI2007] 反素数 (约数)

    传送门 Description 对于任何正整数x,其约数的个数记作g(x).例如g(1)=1.g(6)=4. 如果某个正整数x满足:g(x)>g(i) 0<i<x,则称x为反质数.例 ...

  4. linux ubuntu安装好后,开通远程登录

    1.设置root密码 ubuntu安装好后,用初始的第一个用户登录,然后修改root密码: sudo passwd root 2.检查sshd服务是否启动 (1)查看sshd状态 -----若没有ss ...

  5. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第六篇【AppiumLibrary等待函数介绍】

    http://blog.csdn.net/deadgrape/article/details/50622441 废话不多说,少年们请看下面. Wait Until Page Contains text ...

  6. 编译驱动模块所需的Makefile

    目标定义:就是用来定义哪些内容作为模块编译,哪些内容要编译并链接进内核. obj-y += foo.o 表示要由foo.c或者foo.s文件编译得到foo.o并链接进内核: obj-m则表示该文件要作 ...

  7. D - Constructing Roads

    D - Constructing Roads 思路:并查集板子 #include<cstdio> #include<cstring> #include<iostream& ...

  8. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps 集成SP和Office App

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps  集成SP和Office App         你能够用两种 ...

  9. 简单易学的机器学习算法——神经网络之BP神经网络

    一.BP神经网络的概念     BP神经网络是一种多层的前馈神经网络,其基本的特点是:信号是前向传播的,而误差是反向传播的.详细来说.对于例如以下的仅仅含一个隐层的神经网络模型: watermark/ ...

  10. Java学习之道:Java 导出EXCEL

    1.Apache POI简单介绍  Apache POI是Apache软件基金会的开放源代码函式库.POI提供API给Java程式对Microsoft Office格式档案读和写的功能. .NET的开 ...