def start_app(cls, handlers=None, settings=None):
"""
Initialize the Tornado web application with given handlers and settings.
:param handlers: Handlers (routes) for Tornado
:param settings: Settings for Tornado
:type handlers: list
:type settings: dict
:return: None
"""
if not handlers:
handlers = []
if not settings:
settings = {}
# Not `handlers += cls.handlers` because the wildcard handler should be the last value in handlers
# list. See http://www.tornadoweb.org/en/stable/_modules/tornado/web.html#Application.add_handlers
handlers = cls.handlers + handlers
cls.app = tornado.web.Application(handlers, **settings)
评论列表
文章目录