aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar
diff options
context:
space:
mode:
authorPaulo Scardine2013-05-23 22:50:33 -0300
committerAymeric Augustin2013-10-27 10:24:39 +0100
commitc710140a15222af2cf31b7579c6a5fedf9a482d5 (patch)
tree5ec0c8f997aacdbf24d5d77686f619362d6f5107 /debug_toolbar
parentae52695631b409420aa1cf703a94a80c28c652b7 (diff)
downloaddjango-debug-toolbar-c710140a15222af2cf31b7579c6a5fedf9a482d5.tar.bz2
Allow setting arbitrary attributes on the toolbar.
Fix #334.
Diffstat (limited to 'debug_toolbar')
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html2
-rw-r--r--debug_toolbar/toolbar/loader.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index 7b42c84..cce2144 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -4,7 +4,7 @@
</style>
<link rel="stylesheet" href="{{ STATIC_URL }}debug_toolbar/css/toolbar.min.css" type="text/css" />
<script type="text/javascript" src="{{ STATIC_URL }}debug_toolbar/js/toolbar.min.js"></script>
-<div id="djDebug" style="display:none;" dir="ltr">
+<div id="djDebug" style="display:none;" dir="ltr" {{ TOOLBAR_ROOT_TAG_ATTRS|safe }}>
<div style="display:none;" id="djDebugToolbar">
<ul id="djDebugPanelList">
{% if panels %}
diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py
index 5b55149..491f66c 100644
--- a/debug_toolbar/toolbar/loader.py
+++ b/debug_toolbar/toolbar/loader.py
@@ -18,7 +18,8 @@ class DebugToolbar(object):
base_url = self.request.META.get('SCRIPT_NAME', '')
self.config = {
'INTERCEPT_REDIRECTS': False,
- 'MEDIA_URL': '%s/__debug__/m/' % base_url
+ 'MEDIA_URL': '%s/__debug__/m/' % base_url,
+ 'ROOT_TAG_ATTRS': '',
}
# Check if settings has a DEBUG_TOOLBAR_CONFIG and updated config
self.config.update(getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}))
@@ -26,6 +27,7 @@ class DebugToolbar(object):
'BASE_URL': base_url, # for backwards compatibility
'DEBUG_TOOLBAR_MEDIA_URL': self.config.get('MEDIA_URL'),
'STATIC_URL': settings.STATIC_URL,
+ 'TOOLBAR_ROOT_TAG_ATTRS': self.config.get('ROOT_TAG_ATTRS'),
}
self.load_panels()