gpt4 book ai didi

python - 如何解决 Django AllAuth - 'Connection aborted.' , error(13, 'Permission denied' ) 错误?

转载 作者:太空狗 更新时间:2023-10-29 21:14:42 24 4
gpt4 key购买 nike

我正在尝试解决在 Google App Engine 上运行的 AllAuth/Django 1.7 抛出的连接错误:我相信错误可能出在 session 配置中,但我无法确定问题所在。本地注册运行正常,但社交登录会引发错误。

编辑:LinkedIn 工作正常。

编辑:在本地服务器上;输入凭据后,我得到“必须是 _socket.socket,而不是套接字”。

编辑:AppEngine 服务于 http 或 https 似乎有些歧义;虽然页面是 https,但 URI 是作为 http 接收的。

编辑:我的每点卡住包:

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

这是我的踪迹:

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'))

最佳答案

经过一些研究,AppEngine 的问题似乎与我安装的requests 版本有关。

我通过 pip uninstall requests (2.5.1) 解决了这个问题,然后是 pip install requests==2.3

Source

关于python - 如何解决 Django AllAuth - 'Connection aborted.' , error(13, 'Permission denied' ) 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27974128/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com