欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-06-05 16:14:43
...

需要在中间件类中加入:

 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.
相关标签: Django2.2