Пример #1
0
def start():
    """启动"""
    tornado.options.parse_command_line()
    load_actions()
    handlers = AvenUOM.load()
    logging.info("application.handlers: %s" % str(handlers))
    app = tornado.web.Application(
        handlers=handlers,
        template_path=os.path.join(os.path.dirname(__file__), "templates"),
        static_path=os.path.join(os.path.dirname(__file__), "static"),
        cookie_secret="bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E=",
    )
    http_server = tornado.httpserver.HTTPServer(app)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()
Пример #2
0
def load_actions():
    AvenUOM.import_module("actions.todo")