1

I installed and configured debug_toolbar as the instruction say.See Here, i could even run syncdb.But when i access the admin page i get this error: Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 250, in __call__
    self.load_middleware()

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 47, in load_middleware
    raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))

ImproperlyConfigured: Error importing middleware debug_toolbar.middleware: "No module named toolbar.loader"

And I can't access any other page.Same error. I searched for a while and couldn't find any answer.What i did wrong here?

1
  • Did you add debug toolbar middleware? MIDDLEWARE_CLASSES = ('debug_toolbar.middleware.DebugToolbarMiddleware',)
    – darren
    Feb 12, 2012 at 8:28

4 Answers 4

4

I will support the installation of debug_toolbar when you are inside on Virtualenv. Just make sure that its is activated in your settings.py and then do a :

pip install django-debug-toolbar
1

Do you have the latest version of debug toolbar?

In debug_toolbar/middleware.py the import (line 14) reads:

from debug_toolbar.toolbar.loader import DebugToolbar

See if that matches your debug_toolbar/middleware.py to start with.

It sounds like something is funky with your installation. Check that the directories are alright, and try importing the middleware from ./manage.py shell.

Then perhaps try deleting the debug_toolbar directories manually and reinstalling it with pip if all else fails.

1

If you are using virtualenv, make sure that you have the virtualenv activated where you have installed debug_toolbar.

0

http://django-debug-toolbar.readthedocs.org/en/1.2/configuration.html

  1. 'debug_toolbar' -> INSTALLED_APPS
  2. 'debug_toolbar.middleware.DebugToolbarMiddleware' -> MIDDLEWARE_CLASSES (at first position)
  3. define STATIC_ROOT and ./manage.py collectstatic
  4. DEBUG_TOOLBAR_PATCH_SETTINGS = False
  5. INTERNAL_IPS = ('127.0.0.1',)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.