当使用gunicorn在本地服务器上运行我的应用程序时,我收到以下错误日志:
[2019-06-10 20:12:20 +0200] [34160] [ERROR] Socket error processing request.
Traceback (most recent call last):
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request(listener, req, client, addr)
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 191, in handle_request
six.reraise(*sys.exc_info())
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/six.py", line 625, in reraise
raise value
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 183, in handle_request
resp.close()
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/http/wsgi.py", line 409, in close
self.send_headers()
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/http/wsgi.py", line 329, in send_headers
util.write(self.sock, util.to_bytestring(header_str, "ascii"))
File "/Users/user/Documents/project/venv/lib/python3.6/site-packages/gunicorn/util.py", line 304, in write
sock.sendall(data)
OSError: [Errno 9] Bad file descriptor
Run Code Online (Sandbox Code Playgroud)
我的gunicorn配置如下,我使用gunicorn -w 4 -b …
我正在使用"勇敢"浏览器,当我打开开发人员工具时,他们会在一个单独的窗口中打开.有谁知道如何让它们出现在同一页面上,比如在Chrome/Vivaldi /等中?
我正在尝试设置 Django AllAuth Twitter 登录。当用户使用 Twitter 进行身份验证并重定向到我的网站时,Django AllAuth 会引发错误“无法访问 api.twitter.com 上的私有资源”,我在这里非常迷失。我的settings.py中有以下设置:
SOCIALACCOUNT_PROVIDERS = {
"twitter": {
# From https://developer.twitter.com
"APP": {
"client_id": os.environ["TWITTER_API_KEY"],
"secret": os.environ["TWITTER_API_SECRET"],
}
},
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
DEBUG Signing request <PreparedRequest [POST]> using client <Client client_key={consuner_key}, client_secret=****, resource_owner_key=None, resource_owner_secret=None, signature_method=HMAC-SHA1, signature_type=AUTH_HEADER, callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=utf-8, nonce=None, timestamp=None>
DEBUG Including body in call to sign: False
DEBUG Collected params: [('oauth_callback', 'http://127.0.0.1:8000/accounts/twitter/login/callback/'), ('oauth_nonce', '107239631555922908281648822311'), ('oauth_timestamp', '1648822311'), ('oauth_version', '1.0'), ('oauth_signature_method', 'HMAC-SHA1'), ('oauth_consumer_key', '{consuner_key}')]
DEBUG Normalized params: oauth_callback=http%3A%2F%2F127.0.0.1%3A8000%2Faccounts%2Ftwitter%2Flogin%2Fcallback%2F&oauth_consumer_key={consuner_key}&oauth_nonce=107239631555922908281648822311&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1648822311&oauth_version=1.0
DEBUG Normalized …Run Code Online (Sandbox Code Playgroud)