Django2.2 中间件process_view()报错takes no arguments

需要在中间件类中加入:

 def __init__(self, get_response):
        self.get_response = get_response
        # One-time configuration and initialization
def __call__(self, request):
    # Code to be executed for each request before
    # the view (and later middleware) are called.
发布了12 篇原创文章 · 获赞 1 · 访问量 1246

猜你喜欢

转载自blog.csdn.net/qq_36488647/article/details/100747672
今日推荐