How do I configure the ip address with CherryPy?

后端 未结 3 2464
庸人自扰
庸人自扰 2020-12-03 14:13

I\'m using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the c

3条回答
  •  时光说笑
    2020-12-03 14:26

    import cherrypy
    
    class HelloWorld(object):
        def index(self):
            return "Hello World!"
        index.exposed = True
    
    cherrypy.server.socket_host = '0.0.0.0' # put it here 
    cherrypy.quickstart(HelloWorld())
    

提交回复
热议问题