4

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.

Alasdair
  • 298,606
  • 55
  • 578
  • 516
Elon Musk
  • 332
  • 1
  • 2
  • 12
  • You seem to have more settings that required. The [quick setup](http://django-debug-toolbar.readthedocs.org/en/1.4/installation.html#quick-setup) instructions would probably be enough for you. The `INTERCEPT_REDIRECTS` setting [was deprecated in 1.0](http://django-debug-toolbar.readthedocs.org/en/1.4/changes.html?highlight=INTERCEPT_REDIRECTS#deprecated-features). – Alasdair Apr 11 '16 at 09:38

1 Answers1

5

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

Alasdair
  • 298,606
  • 55
  • 578
  • 516
  • I don't see errors anymore, but the debug toolbar also is invisible. – Elon Musk Apr 11 '16 at 09:31
  • That sounds like a different issue. You should either update your old question and remove the traceback for 1.3, or ask a new question. – Alasdair Apr 11 '16 at 09:33
  • Make sure you are accessing the site with `http://127.0.0.1:8000`, and that `DEBUG = True` in your settings. – Alasdair Apr 11 '16 at 09:39
  • Also note that if you are using bootstrap4, there is a bug that hides django debug toolbar: https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 – Antoine Pinsard Apr 11 '16 at 09:54