/ oauth / login / google-oauth2 /上的Django Google social-auth ModuleNotFoundError>

问题描述 投票:0回答:2

我目前正在尝试为Web应用程序在django中使用social-auth设置社交登录。每当我单击链接到Google登录名的网页上的按钮时,在django网页上都会收到此错误:

    ModuleNotFoundError at /oauth/login/google-oauth2/

No module named 'social_core.backends.google.GoogleOAuth2django'; 'social_core.backends.google' is not a package

Request Method:     GET
Request URL:    http://127.0.0.1:8000/oauth/login/google-oauth2/
Django Version:     3.0.5
Exception Type:     ModuleNotFoundError
Exception Value:    

No module named 'social_core.backends.google.GoogleOAuth2django'; 'social_core.backends.google' is not a package

Exception Location:     C:\Users\isaac\OneDrive\Desktop\DeliverMeProj\venv\lib\site-packages\social_core\utils.py in import_module, line 56
Python Executable:  C:\Users\isaac\OneDrive\Desktop\DeliverMeProj\venv\Scripts\python.exe
Python Version:     3.8.2
Python Path:    

['C:\\Users\\isaac\\OneDrive\\Desktop\\DeliverMeProj',
 'C:\\Program Files\\Python38\\python38.zip',
 'C:\\Program Files\\Python38\\DLLs',
 'C:\\Program Files\\Python38\\lib',
 'C:\\Program Files\\Python38',
 'C:\\Users\\isaac\\OneDrive\\Desktop\\DeliverMeProj\\venv',
 'C:\\Users\\isaac\\OneDrive\\Desktop\\DeliverMeProj\\venv\\lib\\site-packages',
 'C:\\Users\\isaac\\AppData\\Roaming\\Python\\Python38\\site-packages',
 'C:\\Program Files\\Python38\\lib\\site-packages']

Server time:    Sun, 26 Apr 2020 04:12:34 +0000

知道为什么会这样吗?

我目前正在尝试为Web应用程序在django中使用social-auth设置社交登录。每当我单击链接到google登录名的网页上的按钮时,在django网页上都会出现此错误:...

django oauth-2.0 python-social-auth
2个回答
0
投票

您是否安装了python-social-auth


0
投票

我实际上知道了。我在AUTHENTICATIONBACKEND部分中缺少逗号。

© www.soinside.com 2019 - 2024. All rights reserved.