django error:TypeError: __init__() missing 1 required positional argument: 'strategy'

created at 07-17-2021 views: 2

environment

  • django version: 2.1.0
  • The social_django module is used.

description

Django error prompt:

TypeError: __init__() missing 1 required positional argument: 'strategy'

setting.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    # 'social_django',
]    

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'social_core.backends.weibo.WeiboOAuth2',
    'social_core.backends.qq.QQOAuth2',
    'social_core.backends.weixin.WeixinOAuth2',
    'social_core.backends.github.GithubOAuth2',
)

solution

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    # 'social_django',
]    

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    #'social_core.backends.weibo.WeiboOAuth2',
    #'social_core.backends.qq.QQOAuth2',
    #'social_core.backends.weixin.WeixinOAuth2',
    #'social_core.backends.github.GithubOAuth2',
)
Please log in to leave a comment.