发布于 4年前

django创建model错误解答

1.在settings没有添加AUTH_USER_MODEL

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'.

解决:在settings中添加AUTH_USER_MODEL

2.数据库配置参数出错

django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

解决:查看settings中DATABASES参数是否配置出错,比如数据库指定,数据库权限,密码之类

3.因为在django中自定义了命令,报命令重复

django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: commands

解决:删掉自定制的commands,简单的也可以在INSTALLED_APPS中,注释掉commands模块.

©2020 edoou.com   京ICP备16001874号-3