/usr/share/doc/python-django-debug-toolbar-doc/html/configuration.html is in python-django-debug-toolbar-doc 1:1.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuration — Django Debug Toolbar 1.2.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.2.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django Debug Toolbar 1.2.1 documentation" href="index.html" />
<link rel="next" title="Tips" href="tips.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="tips.html" title="Tips"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django Debug Toolbar 1.2.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="configuration">
<h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h1>
<p>The debug toolbar provides two settings that you can add in your project’s
settings module to customize its behavior.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Do you really need a customized configuration?</p>
<p class="last">The debug toolbar ships with a default configuration that is considered
sane for the vast majority of Django projects. Don’t copy-paste blindly
the default values shown below into you settings module! It’s useless and
it’ll prevent you from taking advantage of better defaults that may be
introduced in future releases.</p>
</div>
<div class="section" id="debug-toolbar-patch-settings">
<h2>DEBUG_TOOLBAR_PATCH_SETTINGS<a class="headerlink" href="#debug-toolbar-patch-settings" title="Permalink to this headline">¶</a></h2>
<p>This setting defines whether the toolbar will attempt to automatically adjust
your project’s settings, as described in the <a class="reference internal" href="installation.html"><em>installation instructions</em></a>. By default it has the same value as your <tt class="docutils literal"><span class="pre">DEBUG</span></tt> setting.</p>
</div>
<div class="section" id="debug-toolbar-panels">
<h2>DEBUG_TOOLBAR_PANELS<a class="headerlink" href="#debug-toolbar-panels" title="Permalink to this headline">¶</a></h2>
<p>This setting specifies the full Python path to each panel that you want
included in the toolbar. It works like Django’s <tt class="docutils literal"><span class="pre">MIDDLEWARE_CLASSES</span></tt>
setting. The default value is:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">DEBUG_TOOLBAR_PANELS</span> <span class="o">=</span> <span class="p">[</span>
<span class="s">'debug_toolbar.panels.versions.VersionsPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.timer.TimerPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.settings.SettingsPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.headers.HeadersPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.request.RequestPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.sql.SQLPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.staticfiles.StaticFilesPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.templates.TemplatesPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.cache.CachePanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.signals.SignalsPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.logging.LoggingPanel'</span><span class="p">,</span>
<span class="s">'debug_toolbar.panels.redirects.RedirectsPanel'</span><span class="p">,</span>
<span class="p">]</span>
</pre></div>
</div>
<p>This setting allows you to:</p>
<ul class="simple">
<li>add built-in panels that aren’t enabled by default,</li>
<li>add third-party panels,</li>
<li>remove built-in panels,</li>
<li>change the order of panels.</li>
</ul>
</div>
<div class="section" id="debug-toolbar-config">
<h2>DEBUG_TOOLBAR_CONFIG<a class="headerlink" href="#debug-toolbar-config" title="Permalink to this headline">¶</a></h2>
<p>This dictionary contains all other configuration options. Some apply to the
toolbar itself, others are specific to some panels.</p>
<div class="section" id="toolbar-options">
<h3>Toolbar options<a class="headerlink" href="#toolbar-options" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">DISABLE_PANELS</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">set(['debug_toolbar.panels.redirects.RedirectsPanel'])</span></tt></p>
<p>This setting is a set of the full Python paths to each panel that you
want disabled (but still displayed) by default.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">INSERT_BEFORE</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">'</body>'</span></tt></p>
<p>The toolbar searches for this string in the HTML and inserts itself just
before.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">JQUERY_URL</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">'//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js'</span></tt></p>
<p>URL of the copy of jQuery that will be used by the toolbar. Set it to a
locally-hosted version of jQuery for offline development. Make it empty to
rely on a version of jQuery that already exists on every page of your site.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">RENDER_PANELS</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">None</span></tt></p>
<p>If set to <tt class="docutils literal"><span class="pre">False</span></tt>, the debug toolbar will keep the contents of panels in
memory on the server and load them on demand. If set to <tt class="docutils literal"><span class="pre">True</span></tt>, it will
render panels inside every page. This may slow down page rendering but it’s
required on multi-process servers, for example if you deploy the toolbar in
production (which isn’t recommended).</p>
<p>The default value of <tt class="docutils literal"><span class="pre">None</span></tt> tells the toolbar to automatically do the
right thing depending on whether the WSGI container runs multiple processes.
This setting allows you to force a different behavior if needed.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">RESULTS_STORE_SIZE</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">10</span></tt></p>
<p>The toolbar keeps up to this many results in memory.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">ROOT_TAG_EXTRA_ATTRS</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">''</span></tt></p>
<p>This setting is injected in the root template div in order to avoid
conflicts with client-side frameworks. For example, when using the debug
toolbar with Angular.js, set this to <tt class="docutils literal"><span class="pre">'ng-non-bindable'</span></tt> or
<tt class="docutils literal"><span class="pre">'class="ng-non-bindable"'</span></tt>.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">SHOW_COLLAPSED</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">False</span></tt></p>
<p>If changed to <tt class="docutils literal"><span class="pre">True</span></tt>, the toolbar will be collapsed by default.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">SHOW_TOOLBAR_CALLBACK</span></tt></p>
<p>Default: ‘debug_toolbar.middleware.show_toolbar’</p>
<p>This is the dotted path to a function used for determining whether the
toolbar should show or not. The default checks are that <tt class="docutils literal"><span class="pre">DEBUG</span></tt> must be
set to <tt class="docutils literal"><span class="pre">True</span></tt>, the IP of the request must be in <tt class="docutils literal"><span class="pre">INTERNAL_IPS</span></tt>, and the
request must no be an AJAX request. You can provide your own function
<tt class="docutils literal"><span class="pre">callback(request)</span></tt> which returns <tt class="docutils literal"><span class="pre">True</span></tt> or <tt class="docutils literal"><span class="pre">False</span></tt>.</p>
</li>
</ul>
</div>
<div class="section" id="panel-options">
<h3>Panel options<a class="headerlink" href="#panel-options" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">EXTRA_SIGNALS</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">[]</span></tt></p>
<p>Panel: signals</p>
<p>A list of custom signals that might be in your project, defined as the
Python path to the signal.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">ENABLE_STACKTRACES</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">True</span></tt></p>
<p>Panels: cache, SQL</p>
<p>If set to <tt class="docutils literal"><span class="pre">True</span></tt>, this will show stacktraces for SQL queries and cache
calls. Enabling stacktraces can increase the CPU time used when executing
queries.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">HIDE_IN_STACKTRACES</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">('socketserver',</span> <span class="pre">'threading',</span> <span class="pre">'wsgiref',</span> <span class="pre">'debug_toolbar',</span>
<span class="pre">'django')</span></tt>. The first value is <tt class="docutils literal"><span class="pre">socketserver</span></tt> on Python 3 and
<tt class="docutils literal"><span class="pre">SocketServer</span></tt> on Python 2.</p>
<p>Panels: cache, SQL</p>
<p>Useful for eliminating server-related entries which can result
in enormous DOM structures and toolbar rendering delays.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">PROFILER_MAX_DEPTH</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">10</span></tt></p>
<p>Panel: profiling</p>
<p>This setting affects the depth of function calls in the profiler’s
analysis.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">SHOW_TEMPLATE_CONTEXT</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">True</span></tt></p>
<p>Panel: templates</p>
<p>If set to <tt class="docutils literal"><span class="pre">True</span></tt> then a template’s context will be included with it in the
template debug panel. Turning this off is useful when you have large
template contexts, or you have template contexts with lazy datastructures
that you don’t want to be evaluated.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">SQL_WARNING_THRESHOLD</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">500</span></tt></p>
<p>Panel: SQL</p>
<p>The SQL panel highlights queries that took more that this amount of time,
in milliseconds, to execute.</p>
</li>
</ul>
<p>Here’s what a slightly customized toolbar configuration might look like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># This example is unlikely to be appropriate for your project.</span>
<span class="n">CONFIG_DEFAULTS</span> <span class="o">=</span> <span class="p">{</span>
<span class="c"># Toolbar options</span>
<span class="s">'RESULTS_STORE_SIZE'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="s">'SHOW_COLLAPSED'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="c"># Panel options</span>
<span class="s">'SQL_WARNING_THRESHOLD'</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> <span class="c"># milliseconds</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#debug-toolbar-patch-settings">DEBUG_TOOLBAR_PATCH_SETTINGS</a></li>
<li><a class="reference internal" href="#debug-toolbar-panels">DEBUG_TOOLBAR_PANELS</a></li>
<li><a class="reference internal" href="#debug-toolbar-config">DEBUG_TOOLBAR_CONFIG</a><ul>
<li><a class="reference internal" href="#toolbar-options">Toolbar options</a></li>
<li><a class="reference internal" href="#panel-options">Panel options</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="installation.html"
title="previous chapter">Installation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="tips.html"
title="next chapter">Tips</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/configuration.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="tips.html" title="Tips"
>next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
>previous</a> |</li>
<li><a href="index.html">Django Debug Toolbar 1.2.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013, Django Debug Toolbar developers and contributors.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
|