Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django Rest框架&;Vue.js;通过谷歌账号登录&引用;用户已使用此电子邮件地址注册。”;_Python_Django_Vue.js_Django Rest Framework_Google Authentication - Fatal编程技术网

Python Django Rest框架&;Vue.js;通过谷歌账号登录&引用;用户已使用此电子邮件地址注册。”;

Python Django Rest框架&;Vue.js;通过谷歌账号登录&引用;用户已使用此电子邮件地址注册。”;,python,django,vue.js,django-rest-framework,google-authentication,Python,Django,Vue.js,Django Rest Framework,Google Authentication,我有一些通过谷歌帐号登录我的网站的问题。我通过Google创建了Registraion(使用vue Google登录,然后将数据发送到我的后端dj rest auth/Google/),这很好。但是,如果我试图登录用户,我会从后端服务器得到一个响应“用户已使用此电子邮件地址注册”。我该怎么做才能让用户通过Google帐户登录到我的web应用程序?如何登录用户但不注册 如果有人给我答案,我会很感激,因为我在调试和搜索答案上浪费了太多时间。我会把我的代码放在下面。如果你需要更多信息,请告诉我 谢谢大

我有一些通过谷歌帐号登录我的网站的问题。我通过Google创建了Registraion(使用vue Google登录,然后将数据发送到我的后端dj rest auth/Google/),这很好。但是,如果我试图登录用户,我会从后端服务器得到一个响应“用户已使用此电子邮件地址注册”。我该怎么做才能让用户通过Google帐户登录到我的web应用程序?如何登录用户但不注册

如果有人给我答案,我会很感激,因为我在调试和搜索答案上浪费了太多时间。我会把我的代码放在下面。如果你需要更多信息,请告诉我

谢谢大家!

#authenticate.views
从allauth.socialaccount.providers.google.views导入GoogleOAuth2Adapter
从dj_rest_auth.registration.views导入SocialInview
GoogleLogin类(SocialInview):
adapter_class=GoogleOAuth2Adapter
#authenticate.url
从django.url导入路径
从…起导入视图
URL模式=[
路径('google/',views.GoogleLogin.as_view(),name='google_login')
]
#backend_main.url
从django.contrib导入管理
从django.url导入路径,包括
从django.conf.url导入url
从authentication.views导入Google登录
从后端\u main.api\u视图导入获取路由器\u URL
URL模式=[
路径('admin/',admin.site.url),
路径('hr-api/',包括(get_router_url()),
路径('demo-hr-api/',包括('backend_main.url'),
路径('accounts/',包括('allauth.url'),名称('socialaccount_signup'),
路径('dj-rest-auth/',包括('dj_rest_auth.url'),
路径('dj-rest-auth/registration/',包括('dj_rest_auth.registration.url'),
路径('dj-rest-auth/google/',GoogleLogin.as_view(),name='google_login'),
]