在Cherrypy配置中打开端口

时间:2014-01-29 16:19:59

标签: python cherrypy

#!/usr/bin/python

import cherrypy

cherrypy.config.update({'server.socket_host': "10.0.1.15",'server.socket_port': 80})

class HelloWorld(object):
    def index(self):
        return "HelloWorld"
    index.exposed = True

cherrypy.quickstart(HelloWorld())

这是我的代码,但我得到

[29/Jan/2014:11:16:14] ENGINE Bus STOPPING
[29/Jan/2014:11:16:14] ENGINE HTTP Server             
cherrypy._cpwsgi_server.CPWSGIServer(('10.0.1.15', 80)) already shut down
[29/Jan/2014:11:16:14] ENGINE Stopped thread '_TimeoutMonitor'.
[29/Jan/2014:11:16:14] ENGINE Stopped thread 'Autoreloader'.
[29/Jan/2014:11:16:14] ENGINE Bus STOPPED
[29/Jan/2014:11:16:14] ENGINE Bus EXITING
[29/Jan/2014:11:16:14] ENGINE Bus EXITED

我对内部地址10.0.1.15进行了DHCP预留,并且在我的机场极端设置中也为地址打开了端口80.

0 个答案:

没有答案