2 """Main FastCGI entry point for web interface"""
7 from main import InvirtWeb
10 base_dir = os.path.dirname(__file__)
12 if __name__=="__main__":
13 static_dir = os.path.join(base_dir, 'static')
16 conf_file = sys.argv[1]
19 conf_file = os.path.join(base_dir, 'main.conf')
20 app = cherrypy.tree.mount(InvirtWeb(),
21 '/' if dev else '/main.fcgi',
22 {'/': {'tools.staticdir.root': static_dir},
23 '/static': {'tools.staticdir.on': True,
24 'tools.staticdir.dir': static_dir}
27 cherrypy.config.update(conf_file)
30 cherrypy.server.quickstart()
31 cherrypy.engine.start()
32 cherrypy.engine.block()
34 cherrypy.engine.start(blocking=False)
35 from flup.server.fcgi import WSGIServer
36 server = WSGIServer(app)