gpt4 book ai didi

sockets - socket.gaierror : [Errno 8] nodename nor servname provided,或在 flask 应用程序中未知

转载 作者:行者123 更新时间:2023-12-03 12:04:46 37 4
gpt4 key购买 nike

我遵循了https://developers.openshift.com/en/python-flask.html中提到的步骤
创建 sample 瓶应用程序。

当我尝试在本地Mac机器上运行wsgi.py时。我收到以下错误。

Traceback (most recent call last):
File "wsgi.py", line 24, in <module>
httpd = make_server('localhost', 10000, application)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/simple_server.py",

line 144, in make_server server = server_class((host, port), handler_class) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 419, in init self.server_bind() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind HTTPServer.server_bind(self) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind SocketServer.TCPServer.server_bind(self) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 430, in server_bind self.socket.bind(self.server_address) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.gaierror: [Errno 8] nodename nor servname provided, or not known

最佳答案

我的问题是使用非标准端口。必须与主机分开定义我的端口。

    self.config = {
'user': 'root',
'password': 'root',
'host': '127.0.0.1',
'port': 8889,
'database': 'ET_Toolbox',
'charset': 'utf8'
}

关于sockets - socket.gaierror : [Errno 8] nodename nor servname provided,或在 flask 应用程序中未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31040828/

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