Skip to main content
 首页 » 编程设计

python之DJANGO:没有名为 social_auth.backends.contrib.github 的模块

2024年10月24日32over140

当我尝试使用 github auth 后端登录时出现此错误

No module named social_auth.backends.contrib.github 

设置.py

AUTHENTICATION_BACKENDS = ( 
    'social_auth.backends.contrib.github.GithubBackend', 
    'django.contrib.auth.backends.ModelBackend', 
) 

请您参考如下方法:

应该是

AUTHENTICATION_BACKENDS = ( 
    'django.contrib.auth.backends.ModelBackend', 
    'social.backends.github.GithubOAuth2', 
) 

python-social-auth