tornadowrapper.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:django-tornado-websockets 作者: Kocal 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号