#!/usr/bin/env python # -*- coding: utf-8 -*- import cherrypy class Root(object): pass root = Root() if __name__ == '__main__': config = { '/': { 'tools.staticdir.on': True, 'tools.staticdir.root': '/home/dddh/public_html/cp-20160129', 'tools.staticdir.dir': '.', # 'tools.staticdir.dir': '/home/dddh/public_html/cp-20160129', 'tools.staticdir.index': '_index.html', 'tools.staticdir.debug': True, } } cherrypy.tree.mount(root, '/', config) app = cherrypy.tree.mount(root, '/', config) cherrypy.engine.signals.subscribe() cherrypy.engine.start() cherrypy.engine.block()