flask.py 文件源码

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

项目:annotated-py-flask 作者: hhstore 项目源码 文件源码
def dispatch_request(self):
        """Does the request dispatching.  Matches the URL and returns the
        return value of the view or error handler.  This does not have to
        be a response object.  In order to convert the return value to a
        proper response object, call :func:`make_response`.
        """
        try:
            endpoint, values = self.match_request()    # ????
            return self.view_functions[endpoint](**values)
        except HTTPException, e:
            handler = self.error_handlers.get(e.code)
            if handler is None:
                return e
            return handler(e)
        except Exception, e:
            handler = self.error_handlers.get(500)
            if self.debug or handler is None:
                raise
            return handler(e)

    # ????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号