sanic_application.py 文件源码

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

项目:django-sanic-adaptor 作者: ashleysommer 项目源码 文件源码
def async_legacy_get_response_dj_1_10(self, request):
        """
        Apply process_request() middleware and call the main _get_response(),
        if needed. Used only for legacy MIDDLEWARE_CLASSES.
        """
        response = None
        # Apply request middleware
        for middleware_method in self._request_middleware:
            response = middleware_method(request)
            if isawaitable(response):
                response = await response
            if response:
                break

        if response is None:
            response = await self._get_response_inner_dj_1_10(request)

        return response

    # This function is protected under the Django BSD 3-Clause licence
    # This function is reproduced under the terms of the Django Licence
    # See DJANGO_LICENCE in this source code repository
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号