question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debug toolbar panel is almost always empty

See original GitHub issue

Almost all of the time when I load my site the debug toolbar is empty like this:

http://imgur.com/fj49NHX

I have made the following configurations in my projects settings.py

DEBUG = True
TEMPLATE_DEBUG = DEBUG

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    )

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.webdesign',
    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
     'django.contrib.admindocs',
     'django.contrib.humanize',
     'django.contrib.staticfiles',
     'watrbuzz',
     'watrworld',
     'accounts',
     'whregistration',
     'whprofiles',
     'analytical',
     'watrdata',
     'watrplace',
     'analytical',
     'debug_toolbar',
     'debug_toolbar_mongo',
)

INTERNAL_IPS = (
    '127.0.0.1', 
    'XX.XX.XXX.XXX',
)

DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    #'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.cache.CacheDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
    #'debug_toolbar.panels.redirects.InterceptRedirectsPanel',
    'debug_toolbar_mongo.panel.MongoDebugPanel',
)

def show_toolbar(request):
    return True


DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
    #'SHOW_TOOLBAR_CALLBACK': show_toolbar,
    # 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
    #'HIDE_DJANGO_SQL': False,
    'TAG': 'div',
    'DEBUG_TOOLBAR_MEDIA_ROOT' : ' /usr/lib/python2.7/site-packages/debug_toolbar/', 
    'RENDER_PANELS' : True
    }

I do see the panels populated if I force my webapp to display a traceback. The pages are in HTML and they have the requisite <html></html> <body></body> tags.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
aaugustincommented, Nov 27, 2013

Yes, I’ve just updated the docs to remind readers that blindly copy-pasting stuff without attempting to understand it is likely to yield sub-par results.

1reaction
cruzlutorcommented, Nov 27, 2013

Same Problem

http://snag.gy/FCYng.jpg

MIDDLEWARE_CLASSES = (
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

INTERNAL_IPS = ('127.0.0.1', 'XXX.XXX.XXX.XXX',)

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.templates.TemplatesPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
]

def custom_show_toolbar(request):
    return True  # Always show toolbar, for example purposes only.

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': True,
    'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
    'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
    'HIDE_DJANGO_SQL': False,
    'TAG': 'div',
    'ENABLE_STACKTRACES': True,
    'HIDE_IN_STACKTRACES': ('gunicorn', 'newrelic'),
}

Django 1.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

django-debug-toolbar appears, but is empty (panels are ...
It seems like you are including the middleware too late, try putting DebugToolbarMiddleware at the beginning of the MIDDLEWARE_CLASSES tuple ...
Read more >
Panels — Django Debug Toolbar 3.7.0 documentation
This panels shows the HTTP request and response headers, as well as a selection of values from the WSGI environment. Note that headers...
Read more >
Django Debug Toolbar Documentation
For a simple Django project, that's all you need! The Debug Toolbar will automatically adjust a few settings when you start the development ......
Read more >
Debug Panel - Output
The Output debug panel displays detailed information about a running task and usually provides the best indication of why a task failed. As...
Read more >
Web Debug Toolbar & the Profiler!
This saves us from needing to use Flash or encode videos in multiple formats. And that let's us get back to making more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found