django-allauth错误,“ ModelBackend”对象没有属性

时间:2019-06-02 11:04:40

标签: python django django-allauth

Django 2.2.1 Python 3.7.3

settings.py文件添加了以下内容:

AUTHENTICATION_BACKENDS = (
...
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
...
)
  • 我已经设置了django-allauth,而不是创建超级用户,

然后执行python manage.py makemigrations && python manage.py migrate

已执行python manage.py createsuperuser --username admin --email admin@admin.com, ,发生错误:

  

回溯(最近通话最近):     在第21行的文件“ manage.py”中       主要()     主文件第17行中的文件“ manage.py”       execute_from_command_line(sys.argv)     在execute_from_command_line中的文件“ /home/web/venv_a/lib/python3.7/site-packages/django/core/management/init.py”中,>行381       utility.execute()     在执行中,文件“ /home/web/venv_a/lib/python3.7/site-packages/django/core/management/init.py”,>行375       self.fetch_command(子命令).run_from_argv(self.argv)     在run_from_argv中,文件“ /home/web/venv_a/lib/python3.7/site-packages/django/core/management/base.py”,第323行       self.execute(* args,* * cmd_options)     执行中的文件“ /home/web/venv_a/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py”,第61行       返回super()。execute(* args,* * options)     在执行中,文件“ /home/web/venv_a/lib/python3.7/site-packages/django/core/management/base.py”,行364       输出= self.handle(* args,* 选项)     句柄中的文件“ /home/web/venv_a/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py”,第132行      validate_password(password2,self.UserModel( * fake_user_data))     文件“ /home/web/venv_a/lib/python3.7/site-packages/django/contrib/auth/password_validation.py”,第47行,在validate_password中       validateator.validate(密码,用户)

     

AttributeError:“ ModelBackend”对象没有属性“ validate”

  在/ admin / auth / user / add /中的

AttributeError   'ModelBackend'对象没有属性'get_help_text'

如何解决?谢谢。

0 个答案:

没有答案