Reputation: 83
We installed the django toolbar yesterday on our remote server and have been trying for it to show on the page itself. I have gone through all the questions here and on google about it and have all the settings the way they are suppose to be. Like the INTERNAL_IPS, DEBUG, MIDDLEWARE_CLASSES etc. The toolbar code is showing up in the source html but I cant see any buttons on the screen. I m ready to pull my hair out on this thing. Please help! Below I m pasting the toolbar code that is showing up before my tag in the html.
<script type="text/javascript">
// <![CDATA[
var DEBUG_TOOLBAR_MEDIA_URL = "/__debug__/m/";
// ]]>
</script>
<script type="text/javascript" src="/__debug__/m/js/toolbar.min.js"></script>
<div id="djDebug" style="display:none;">
<div style="display:none;" id="djDebugToolbar">
<ul id="djDebugPanelList">
<li><a id="djHideToolBarButton" href="#" title="Hide Toolbar">Hide » </a></li>
<li>
<a href="#" title="Versions" class="djDebugVersionPanel">
Versions
<br /><small>Django 1.4</small>
</a>
</li>
<li>
<a href="#" title="Resource Usage" class="djDebugTimerPanel">
Time
<br /><small>CPU: 220.01ms (251.44ms)</small>
EDIT: I m adding the settings.py part of my app:
if DEBUG:
INTERNAL_IPS = ('my machine's IP',)
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INSTALLED_APPS += (
'debug_toolbar',
)
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.profiling.ProfilingDebugPanel',
'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_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}
def show_toolbar(request):
return True # Always show toolbar, for example purposes only.
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
# 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
'HIDE_DJANGO_SQL': False,
# 'TAG': 'html',
'DEBUG_TOOLBAR_MEDIA_URL' : '/usr/local/lib/python2.6/dist-packages/django_debug_toolbar-0.8.5-py2.6.egg/debug_toolbar/media'
}
Upvotes: 2
Views: 4911
Reputation: 1
In Windows, search registry and edit the registry under HKEY_CLASSES_ROOT.js\Content Type from text/plain to text/javascript
Also clear your browser cache and reload.
Watch this video it will help. https://youtu.be/45bluSqKqNE
Upvotes: 0
Reputation: 11
Including other things, you need to confirm the following lines in settings.py file:
mimetypes
mimetypes.add_type("application/javascript", ".js", True)
DJANGO_DEBUG = True
Upvotes: 0
Reputation: 7552
The meaning of SHOW_TOOLBAR_CALLBACK
have changed to require a string and not support a callable.
def custom_show_toolbar(request):
return True # Always show toolbar, for example purposes only.
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'your_project_name.settings.custom_show_toolbar',
}
Upvotes: 2
Reputation: 45112
Latest version of debug toolbar is 0.9.4 It's worth a shot to upgrade--maybe a bug was fixed sometime along the way.
Upvotes: 1
Reputation: 12951
This is a wild guess, but I've had this problem before : your html code is not correct. I think I had a missing tag that prevented the debug toolbar from displaying but that otherwise was not a problem.
Disable the debug toolbar and check that you page is correct (use the w3c validator, for example). If you find any html issues, correct it. It might make the debug toolbar work again.
Upvotes: 2