aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS14
-rw-r--r--LICENSE27
-rw-r--r--README.rst7
-rw-r--r--debug_toolbar/panels/settings_vars.py12
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/settings_vars.html35
-rw-r--r--debug_toolbar/toolbar/loader.py3
6 files changed, 69 insertions, 29 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..6107ef8
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,14 @@
+The Django Debug Toolbar was original created by Rob Hudson <rob@cogit8.org> in
+August 2008.
+
+The following is a list of much appreciated contributors:
+
+David Cramer <dcramer@gmail.com>
+Alex Gaynor <alex.gaynor@gmail.com>
+Matt George <matt.george@myemma.com>
+Jacob Kaplan-Moss <jacob@jacobian.org>
+Jannis Leidel <jannis@leidel.info>
+Nowell Strite <nowell@strite.org>
+Malcolm Tredinnick <malcolm@pointy-stick.com>
+Bryan Veloso <bryan@revyver.com>
+Simon Willison <simon@simonwillison.net>
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..15d8309
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Rob Hudson and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of Django nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.rst b/README.rst
index 7c0c8f3..0e83468 100644
--- a/README.rst
+++ b/README.rst
@@ -10,11 +10,12 @@ Currently, the following panels have been written and are working:
- Django version
- Request timer
+- A list of settings in settings.py
- Common HTTP headers
- GET/POST/cookie/session variable display
+- Templates and context used, and their template paths
- SQL queries including time to execute and links to EXPLAIN each query
- Cache stats
-- Templates and context used, and their template paths
- Logging output via Python's built-in logging module
If you have ideas for other panels please let us know.
@@ -54,11 +55,12 @@ Installation
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.template.TemplateDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.cache.CacheDebugPanel',
- 'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
)
@@ -68,7 +70,6 @@ Installation
TODO
====
-- Panel idea: Show some commonly used settings from settings.py
- Panel idea: AJAX call to show cprofile data similar to the ?prof idea
- CSS Stylings
- Restructure panels to popular context that pushes up to the toolbar
diff --git a/debug_toolbar/panels/settings_vars.py b/debug_toolbar/panels/settings_vars.py
index db0ea1d..e090718 100644
--- a/debug_toolbar/panels/settings_vars.py
+++ b/debug_toolbar/panels/settings_vars.py
@@ -1,7 +1,7 @@
-from django.template.loader import render_to_string
-from debug_toolbar.panels import DebugPanel
from django.conf import settings
+from django.template.loader import render_to_string
from django.views.debug import get_safe_settings
+from debug_toolbar.panels import DebugPanel
class SettingsVarsDebugPanel(DebugPanel):
"""
@@ -11,15 +11,13 @@ class SettingsVarsDebugPanel(DebugPanel):
has_content = True
def title(self):
- return 'Settings Vars'
+ return 'Settings'
def url(self):
return ''
def content(self):
- import logging
- settings_dict = get_safe_settings()
context = {
- 'settings': settings_dict,
+ 'settings': get_safe_settings(),
}
- return render_to_string('debug_toolbar/panels/settings_vars.html', context) \ No newline at end of file
+ return render_to_string('debug_toolbar/panels/settings_vars.html', context)
diff --git a/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html b/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
index b139a43..f1e6684 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/settings_vars.html
@@ -1,18 +1,17 @@
-<h3 id="settings-info">Settings</h3>
-<h4>Using settings module <code>{{ settings.SETTINGS_MODULE }}</code></h4>
-<table class="req">
- <thead>
- <tr>
- <th>Setting</th>
- <th>Value</th>
- </tr>
- </thead>
- <tbody>
- {% for var in settings.items|dictsort:"0" %}
- <tr>
- <td>{{ var.0 }}</td>
- <td class="code"><div>{{ var.1|pprint }}</div></td>
- </tr>
- {% endfor %}
- </tbody>
-</table> \ No newline at end of file
+<h3>Settings from <code>{{ settings.SETTINGS_MODULE }}</code></h3>
+<table>
+ <thead>
+ <tr>
+ <th>Setting</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for var in settings.items|dictsort:"0" %}
+ <tr>
+ <td>{{ var.0 }}</td>
+ <td><code>{{ var.1|pprint }}</code></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py
index 29ab46e..b217665 100644
--- a/debug_toolbar/toolbar/loader.py
+++ b/debug_toolbar/toolbar/loader.py
@@ -15,11 +15,12 @@ class DebugToolbar(object):
self.default_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.template.TemplateDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.cache.CacheDebugPanel',
- 'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
)
self.load_panels()