I would like to access my CherryPy site on a different computer, but I have tried the answers form here and here, but neither have worked. I am using a Mac with OSX El Capitan, Python 3.5.2, and I believe, the latest version of CherryPy. This is my current code, I do not care what the address is, just that it works. Thanks for any help!
import cherrypy
class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
# bind to all IPv4 interfaces
cherrypy.config.update({'server.socket_host': '0.0.0.0'})
cherrypy.quickstart(HelloWorld())
EDIT:
I can access the site from localhost:8080
127.0.0.1
and 0.0.0.0
. The console output is this:
[26/Jul/2016:19:10:26] ENGINE Listening for SIGTERM.
[26/Jul/2016:19:10:26] ENGINE Listening for SIGHUP.
[26/Jul/2016:19:10:26] ENGINE Listening for SIGUSR1.
[26/Jul/2016:19:10:27] ENGINE Bus STARTING
Warning (from warnings module):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/cherrypy/_cpchecker.py", line 105
warnings.warn(msg)
UserWarning: The Application mounted at '' has an empty config.
[26/Jul/2016:19:10:27] ENGINE Started monitor thread '_TimeoutMonitor'.
[26/Jul/2016:19:10:27] ENGINE Started monitor thread 'Autoreloader'.
[26/Jul/2016:19:10:27] ENGINE Serving on http://0.0.0.0:8080
[26/Jul/2016:19:10:27] ENGINE Bus STARTED
I run my file using IDLE, and I am not using a firewall.