diff options
| author | Aymeric Augustin | 2013-11-27 21:53:24 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-27 22:00:34 +0100 |
| commit | d413daa29fea312729aacbad3a9070da4f0299dd (patch) | |
| tree | 038194b3c47d75bf1529b99d9ee95419ae84d8f9 | |
| parent | 2c5fae5c5582cdc00535ca16b0b2f5e3d27c6244 (diff) | |
| download | django-debug-toolbar-d413daa29fea312729aacbad3a9070da4f0299dd.tar.bz2 | |
Attempt to protect copy-paste-happy programmers from themselves.
Judging by issue 469, "copy-paste whatever piece of code I come across
without even reading it and then whine" is a popular programming
technique. Since I cannot change significantly this behavior, I'm
replacing the configuration example with something harmless but slightly
obnoxious and adding a warning that will only ever be read by people who
don't need it, in an attempt to dam the flow of complaints.
| -rw-r--r-- | docs/configuration.rst | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/docs/configuration.rst b/docs/configuration.rst index 9f97c32..1e527e2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -4,6 +4,14 @@ Configuration The debug toolbar provides two settings that you can add in your project's settings module to customize its behavior. +.. note:: Do you really need a customized configuration? + + 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. + DEBUG_TOOLBAR_PANELS -------------------- @@ -154,17 +162,14 @@ Panel options The SQL panel highlights queries that took more that this amount of time, in milliseconds, to execute. -Here's an example:: - - def custom_show_toolbar(request): - return True # Always show toolbar, for example purposes only. +Here's what a slightly customized toolbar configuration might look like:: - DEBUG_TOOLBAR_CONFIG = { + # This example is unlikely to be appropriate for your project. + CONFIG_DEFAULTS = { + # Toolbar options + 'RESULTS_STORE_SIZE': 3, + 'SHOW_COLLAPSED': True, + # Panel options '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'), + 'SQL_WARNING_THRESHOLD': 100, # milliseconds } |
