saxman01
saxman01

Reputation: 288

django-debug-toolbar appears, but is empty (panels are not populating)

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

https://i.sstatic.net/NV4JO.jpg

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.

Upvotes: 4

Views: 1923

Answers (1)

jbub
jbub

Reputation: 2665

It seems like you are including the middleware too late, try putting DebugToolbarMiddleware at the beginning of the MIDDLEWARE_CLASSES tuple.

See: http://django-debug-toolbar.readthedocs.org/en/latest/installation.html#middleware

Also you need to look at the javascript length error, can you detect the source of that error ?

Upvotes: 1

Related Questions