socket.gaierror: [Errno 8] nodename nor servname provided, or not known in flask app
socket.gaierror: [Errno 8] nodename nor servname provided, or not known in flask app
我遵循了 https://developers.openshift.com/en/python-flask.html 中提到的步骤
创建示例烧瓶应用程序。
当我尝试在本地 mac 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'
}
我遵循了 https://developers.openshift.com/en/python-flask.html 中提到的步骤 创建示例烧瓶应用程序。
当我尝试在本地 mac 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'
}