问题描述
我正在尝试解决在Google App Engine上运行的AllAuth / Django 1.7引发的连接错误:
我认为错误可能在Sessions配置中,但我无法识别问题。
本地注册功能正常,但社交登录错误。
编辑: b
$ b
编辑:在本地服务器上;输入证书后,我得到必须是_socket.socket,而不是套接字。
编辑: AppEngine的服务似乎有些含糊不清http或https;尽管页面是https,但是正在以http的形式收到该URI。
编辑:我的软件包每个点冻结:
AppEngine-Email-Backend == 1.0
Django == 1.7.2
GoogleAppEngineCloudStorageClient == 1.9.15.0
MySQL-python == 1.2.4b4
bootstrap-admin == 0.3.3
django-allauth == 0.19.0
django-appengine-toolkit == 0.2.1
django-crispy-forms == 1.4.0
django-localflavor == 1.1
djangoappengine == 1.6.3
djangotoolbox == 1.6.2
mysqlclient == 1.3.4
oauthlib == 0.7.2
python-openid == 2.2.5
请求== 2.5.1
requests-oauthlib == 0.4.2
wsgiref = = 0.1.2
这是我的追踪:
请求方法:GET
请求URL:https:// [app] .appspot.com / accounts / google / login / callback /?state = LrL6Pw08bT7r& code = 4 /Og6R5AWIQX9WFGyF7XsXAVJHfbyBLRbIqxnflCyS2Kg.omD5uljwob8dPm8kb2vw2M1dUc7elQI
Django版本:1.7.2
Python版本:2.7.5
已安装应用程序ns:
('bootstrap_admin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
' django.contrib.admindocs',
'django.contrib.sitemaps',
'django.contrib.flatpages',
'appengine_toolkit',
'djangoappengine',
'localflavor',
'crispy_forms',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount。
('django.contrib.sessions.middleware.SessionMiddleware',
')安装的中间件:
('django.contrib.sessions.middleware.SessionMiddleware',
' django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth。 middlewar e.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware' )
追溯:
文件/base/data/home/apps/s~[app]/3.381542196672942284/django/core/handlers/base.pyin get_response
111. response = wrapped_callback(request,* callback_args,** callback_kwargs)
文件/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/ oauth2 / views.pyin view
54. return self.dispatch(request,* args,** kwargs)
文件/base/data/home/apps/s~[app]/3.381542196672942284 /site_packages/allauth/socialaccount/providers/oauth2/views.py在调度
109. access_token = client.get_access_token(request.GET ['code'])
文件/ base / data / home /apps/s~[app]/3.381542196672942284/site_packages/allauth/soci $ a
文件/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/api中的alaccount / providers / oauth2 / client.pyin get_access_token
.py请求
49. response = session.request(method = method,url = url,** kwargs)
文件/ base / data / home / apps / s〜[app] / 3.381542196672942284 / site_packages / requests / sessions.py请求
461. resp = self.send(prep,** send_kwargs)
文件/ base / data / home / apps / s〜[app] /3.381542196672942284/site_packages/requests/sessions.pyin send
573. r = adapter.send(request,** kwargs)
文件/ base / data / home / apps / s〜[app ] /3.381542196672942284/site_packages/requests/adapters.py发送
415. raise ConnectionError(err,request = request)
异常类型:ConnectionError at / accounts / google / login / callback /
异常值:('Connection aborted。',error(13,'Permission denied'))
在进行了一些研究之后,似乎AppEngine的问题与我安装的请求相关。
我通过 pip卸载请求
(2.5.1),然后 pip install requests == 2.3
解决了这个问题。 >
I'm trying to resolve a connection error thrown by AllAuth/Django 1.7 running on Google App Engine:I believe the error may be in the Sessions configuration but I've not been able to identify the problem.Local signup is functioning correctly, but social logins throw an error.
edit: LinkedIn works fine.
edit: On the local server; I get "must be _socket.socket, not socket" after entering credentials.
edit: There seems to be some ambiguity with what AppEngine serving http or https; although the page is https, the URI is being received as http.
edit: My packages per pip freeze:
AppEngine-Email-Backend==1.0
Django==1.7.2
GoogleAppEngineCloudStorageClient==1.9.15.0
MySQL-python==1.2.4b4
bootstrap-admin==0.3.3
django-allauth==0.19.0
django-appengine-toolkit==0.2.1
django-crispy-forms==1.4.0
django-localflavor==1.1
djangoappengine==1.6.3
djangotoolbox==1.6.2
mysqlclient==1.3.4
oauthlib==0.7.2
python-openid==2.2.5
requests==2.5.1
requests-oauthlib==0.4.2
wsgiref==0.1.2
Here's my trace:
Request Method: GET
Request URL: https://[app].appspot.com/accounts/google/login/callback/?state=LrL6Pw08bT7r&code=4/Og6R5AWIQX9WFGyF7XsXAVJHfbyBLRbIqxnflCyS2Kg.omD5uljwob8dPm8kb2vw2M1dUc7elQI
Django Version: 1.7.2
Python Version: 2.7.5
Installed Applications:
('bootstrap_admin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.admindocs',
'django.contrib.sitemaps',
'django.contrib.flatpages',
'appengine_toolkit',
'djangoappengine',
'localflavor',
'crispy_forms',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
'supplier',
'main')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
Traceback:
File "/base/data/home/apps/s~[app]/3.381542196672942284/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/views.py" in view
54. return self.dispatch(request, *args, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/views.py" in dispatch
109. access_token = client.get_access_token(request.GET['code'])
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/client.py" in get_access_token
57. data=data)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/api.py" in request
49. response = session.request(method=method, url=url, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/sessions.py" in request
461. resp = self.send(prep, **send_kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/sessions.py" in send
573. r = adapter.send(request, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/adapters.py" in send
415. raise ConnectionError(err, request=request)
Exception Type: ConnectionError at /accounts/google/login/callback/
Exception Value: ('Connection aborted.', error(13, 'Permission denied'))
After doing some research, it seems AppEngine's problems were related to my installed version of requests.
I resolved this by pip uninstall requests
(2.5.1), then pip install requests==2.3
.
这篇关于如何解决Django AllAuth - “连接中止”,错误(13,“权限被拒绝”)错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!