I followed the steps mentioned in https://developers.openshift.com/en/python-flask.html to create a sample flask application.
When I am trying to run wsgi.py on my local mac machine. I am getting the following error.
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
'localhost'
and10000
as separate parameters as opposed to a tuple('localhost', 10000)
as expected, but can't say so without your actual code that's causing this exception – gabhijithttpd
object and run it should only be run on your local machine and should be guarded by check of__name__
being__main__
. When deploying as awsgi.py
file to OpenShift, it will run under mod_wsgi and all it wants is that there is a WSGI application entry point in the file calledapplication
. You should not start your own WSGI server if usingwsgi.py
. – Graham Dumpleton