/core/handlers/base.py", line 79, in load_middlewareTypeError:object() takes no parameters 我有这样的文件夹结构: ? "Couldn't import Django.',
'django.middleware.common.CommonMiddleware'
我正在尝试编写自定义中间件,以捕获异常并返回正确的HTTP响应对象。但出于某种原因,我得到了一个“中间件对象不可调用”错误。", line 47, in innerbackend_1 | TypeError: 'MyAppResponseMiddleware' object is not callable #myapp/mi
但是Django继续抛出异常WSGIRequest object has no attribute 'is_authenticated'。我阅读了关于堆栈溢出和github有关这个问题的一些类似的问题,每个人都指向移动中间件,我已经尝试了几乎所有的方法来重构我的中间件,就像在其他问题的答案中提到的一样,但是我没有能够解决它。request.is_authenticated: