我正在尝试安装django-debug-toolbar
每当我在设置中添加中间件时,我都会收到以下错误:
File "<project_path>/.env/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 153, in __init__
self.load_middleware()
File "<project_path>/.env/lib/python3.5/site-packages/django/core/handlers/base.py", line 82, in load_middleware
mw_instance = middleware(handler)
TypeError: __init__() takes 1 positional argument but 2 were given
我的 settings.py 包含所有必要的东西:
INSTALLED_APPS = [
#...
'django.contrib.staticfiles',
'debug_toolbar',
#...
]
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
#....
#....
]
MIDDLEWARE_CLASSES = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
]