0

I'm trying to install django-debug-toolbar

Whenever I add the middleware in the settings, I'm getting the following error:

  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

my settings.py contains all the necessary stuff:

INSTALLED_APPS = [
    #...
    'django.contrib.staticfiles',
    'debug_toolbar',
    #...

]
MIDDLEWARE = [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    #....
    #....

]
MIDDLEWARE_CLASSES = [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
]

2 Answers 2

1

In 1.10, you have to upgrade django-debug-toolbar to support MIDDLEWARE and MIDDLEWARE_CLASSES

pip install django-debug-toolbar --upgrade
Sign up to request clarification or add additional context in comments.

Comments

0

I had to upgrade the django-debug-toolbar as mentioned in this answer and then add a line in the settings file:

INTERNAL_IPS = ('127.0.0.1')

to make the toolbar visible

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.