cherrypy_installed = False def install(): global cherrypy_installed if cherrypy_installed: return import cherrypy cherrypy.root = FAKE_ROOT cherrypy.server.start(initOnly=True, serverClass=None) cherrypy_installed = True def make_app(global_conf): install() from cherrypy._cpwsgi import wsgiApp return wsgiApp