Search code examples
pythondjangodjango-debug-toolbar

django debug toolbar throws Improperly Configured Exception


I have django 1.9 an django-debug-toolbar==1.3.0 installed. Here is my settings.py content

# debug_toolbar settings
if DEBUG:
    INTERNAL_IPS = ('127.0.0.1',)
    MIDDLEWARE_CLASSES += (
        'debug_toolbar.middleware.DebugToolbarMiddleware',
    )

    INSTALLED_APPS += (
        'debug_toolbar',
    )

    DEBUG_TOOLBAR_PANELS = [
        'debug_toolbar.panels.versions.VersionsPanel',
        'debug_toolbar.panels.timer.TimerPanel',
        'debug_toolbar.panels.settings.SettingsPanel',
        'debug_toolbar.panels.headers.HeadersPanel',
        'debug_toolbar.panels.request.RequestPanel',
        'debug_toolbar.panels.sql.SQLPanel',
        'debug_toolbar.panels.staticfiles.StaticFilesPanel',
        'debug_toolbar.panels.templates.TemplatesPanel',
        'debug_toolbar.panels.cache.CachePanel',
        'debug_toolbar.panels.signals.SignalsPanel',
        'debug_toolbar.panels.logging.LoggingPanel',
        'debug_toolbar.panels.redirects.RedirectsPanel',
    ]

    DEBUG_TOOLBAR_CONFIG = {
        'INTERCEPT_REDIRECTS': False,
    }

I have validated that DEBUG is set to True. When running the server, I get the following error -

django.core.exceptions.ImproperlyConfigured: Error importing debug panel debug_toolbar.panels.versions: "cannot import name linebreak_iter"

The entire stacktrace can be found here - https://gist.github.com/anonymous/7a48e7c24d530118e5dfc0a75b982be2

What is going wrong? TIA.


Solution

  • Debug toolbar 1.3 does not support Django 1.9. You should upgrade to version 1.4 which does.