robhudson / django-debug-toolbar
- Source
- Commits
- Network (79)
- Issues (26)
- Downloads (3)
- Wiki (2)
- Graphs
-
Branch:
master
-
It could show all the registered handlers for each of the signals built into django (and probably have a hook for registering custom signals).
Comments
-
See http://www.djangosnippets.org/snippets/605/. My thinking is this will trigger a new request to profile that specific URL and show the results.
Comments
binarydud has started working on this here:
http://github.com/binarydud/django-debug-toolbar/tree/profile
I've got a fork of binarydud's profile panel with a couple of improvements. All of the implementations I've seen naively call the view twice because they expect that returning a response from within process_view will short circuit processing as it does for real middleware. The debug toolbar actually discards anything returned from process_view so this doesn't happen. I've changed this in my fork to return the last response returned (if any) from the panels. Unfortunately, panel order is now theoretically more important, but profiling works much better. Also, I've added checks to disable profiling if the response is actually generated from another middleware, like flatpages, because process_view is never called for these requests.
-
0 comments Created 8 months ago by robhudsonRefactor code so context pushes up into a single toolbar contextenhancementxComments
-
2 comments Created 8 months ago by robhudsonDjango Debug Toolbar should be translatableenhancementx -
1 comment Created 8 months ago by robhudsondefectxFind a solution to the toolbar wrapping if browser not wide enoughverifiedxMalcolm has a patch on his tree that's mostly there:
git://sharp.pointy-stick.com/django-debug-toolbar.git
Comments
-
Comments
matclayton
Fri Dec 04 03:37:15 -0800 2009
| link
Any news on this, or idea when it will be possible to bring this back, it was probably the most useful feature on DDT for us.
The last person working on it was Martin Maney on his branch:
http://github.com/mmaney/django-debug-toolbarIf you have a moment, it would be helpful to know if what he has is working for you. The toolbar itself may be a bit dated but if the Caching stuff works that would tell me a lot.
-
When INTERCEPT_REDIRECTS enabled, cookies set by app's redirect response will be lost.
By example, in a login view, app set a user_id cookie on a redirect response, but this cookie does not send to browser actually.
(Originally added by: flytwokites on Google Code)
Comments
Here is a patch to address this problem:
From <a href="/robhudson/django-debug-toolbar/commit/9fab69c4c41bd0376c8b5c01430a646698776b6a">9fab69c</a> Mon Sep 17 00:00:00 2001 From: http://github.com/ziz Date: Sun, 22 Nov 2009 15:07:25 -0700 Subject: [PATCH] Set cookies during middleware intercept. It would probably be helpful to compare these cookies to the initial request's cookies and display the differences in the redirect template, since the debug toolbar doesn't otherwise have an opportunity to show them. --- debug_toolbar/middleware.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 5c10f9f..264515e 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -79,10 +79,12 @@ class DebugToolbarMiddleware(object): if isinstance(response, HttpResponseRedirect): redirect_to = response.get('Location', None) if redirect_to: + cookies = response.cookies response = render_to_response( 'debug_toolbar/redirect.html', {'redirect_to': redirect_to} ) + response.cookies = cookies if response.status_code == 200: for panel in self.debug_toolbars[request].panels: panel.process_response(request, response) -- 1.6.4.1It does not display the cookies set in the redirect page, but at least it addresses the functional problem.
-
3 comments Created 8 months ago by robhudsondefectxSub SELECT queries should be idented correctlyverifiedxWhat steps will reproduce the problem?
Make any kind of sub selects with orm (like in example, or query with "WHERE ..._id IN ( SELECT ... ) ..." )
SELECT (SELECT group_id FROM auth_user_groups WHERE auth_user_groups.user_id = auth_user.id LIMIT 1) AS
first_user_group,auth_user.id,auth_user.username,auth_user.first_name,auth_user.last_name,auth_user.email,auth_user.password,auth_user.is_staff,auth_user.is_active,auth_user.is_superuser,auth_user.last_login,auth_user.date_joinedFROMauth_userLEFT OUTER JOINauth_user_groupsON (auth_user.id=auth_user_groups.user_id) ORDER BYauth_user_groups.group_idASC
What is the expected output? What do you see instead?
Correct output should looks like this:
SELECT (SELECT group_id FROM auth_user_groups WHERE auth_user_groups.user_id = auth_user.id LIMIT 1) AS `first_user_group`, `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`is_superuser`, `auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user` LEFT OUTER JOIN `auth_user_groups` ON (`auth_user`.`id` = `auth_user_groups`.`user_id`) ORDER BY `auth_user_groups`.`group_id` ASCWhat version of the product are you using? On what operating system?
Originally added by overkrik on Google Code.
Comments
We could make use of SQL format for this, either the local library, or the API:
Yeah, that's a nice library. I was playing with it in a this gist: http://gist.github.com/118990
I have to look at the API for it a bit closer but it adds a newline after every column name which might be a bit too much for the sql panel.
-
Similar to Dowser, look at implementing a memory tracking panel.
Comments
I've just ported the Dowser as standalone app for django. This may be handy for some: http://code.google.com/p/django-dowser/
-
1 comment Created 8 months ago by robhudsonConsider adding python-sqlparseenhancementxConsider adding python-sqlparse as an optional library to parse/display SQL queries vs our hack job.
Comments
-
Consider using Jannis' package for docs hosted on PyPI:
http://pypi.python.org/pypi/Sphinx-PyPI-upload/Comments
-
0 comments Created 2 months ago by robhudsondefectxBoolean parameters don't survive JSON/urlencode in SQL panel SELECT subpanelverifiedxAfter looking briefly I believe the problem is using force_unicode on each parameter resulting in a parameter of
(True,)turning into("True",), which doesn't get turned back into the raw boolean when trying to re-execute the query resulting in a database error.Comments
-
class="close" needs to be renamed to avoid conflict
1 comment Created 2 months ago by robhudson -
1 comment Created 2 months ago by jezdezAdd ability to toggle each panel from the frontendenhancementxI was wondering if it would be a good idea to provide a separate panel that would allow the user to toggle each panel from the frontend. That'd useful e.g. in case the SQL panel takes to long to render and wouldn't require deactivating it site-wide.
Additionally this could be only used on a specific url/path, so that the toggle would survive clicking around the site. That option would be given the user to make in the panel, too.
I guess the toggle state could be saved in a cookie.
Comments
Agreed, this would be a good addition. The user interface for such a thing might be difficult. There have been times, with large Django installations, that I've had to disable most panels to get a reasonable time to render the response (due to the (a) extra introspection the debug toolbar has to do, (b) the extra template rendering, and (c) the extra HTML rendering by the browser).
I think saving state is best done in the cookie, similar to how we're saving the minimized state there already.
-
1 comment Created 3 months ago by simonwdefectxAvoid issues if user is running different jQuery versionverifiedxdjango-debug-toolbar failed for me on a site running jQuery 1.3.2 - I think it's because of library version incompatibilities.
Armin describes a way of ensuring the version of jQuery that ships with the toolbar is the one used by its scripts, without interfering with the jQuery version in use on the site, here:
Comments
Yes, Armin submitted a patch on his branch:
http://github.com/mitsuhiko/django-debug-toolbarIt did not work for me, however. I need to spend more time with it to determine why.
It's a bit of a challenge since it has to work in many cases...
- If there's not jQuery
- If there is already a jQuery
- If there are other libraries (mootools, prototype, etc)
- If there's not jQuery
-
I'm seing some rather high loading times when I have the toolbar enabled, here's a profiler dump: http://dpaste.de/NSve/
Some 18 seconds spent in render_node. This is when working on http://github.com/mikl/pinax/commits/mingus and it happens for every page load.
I'm not quite sure how to debug this further, but it is on Django 1.0.3.
Comments
This looks like it's calling Django's build in debug template tag. There is no
debug.pyfile in the debug toolbar.
I've found that the problem only occurs if I enable
debug_toolbar.panels.template.TemplateDebugPanelAlex Gaynor ran into this as well if your templates have a very large context. To help alleviate these cases we've added the
SHOW_TEMPLATE_CONTEXTsetting to disable including context in the template panel. People may want to disable this also if they have lazy datastructures that may trigger extra queries.I'll close for now. If it turns out this isn't the case feel free to re-open. I should probably start a FAQ or something which covers common problems.
SmileyChris
Mon Sep 28 15:15:11 -0700 2009
| link
This is most noticable if you have 'request' in the context, because that has a large unicode representation to begin with. Combine that with many included templates and the real problem rears it's head: all template contexts are being displayed rather than the specific context for that template (due to silly short variable names).
in panels/template.py, replace pformat(d) with pformat(_d) and the problem is mostly resolved.
It shows how much people actually look in the template context in this panel :P
SmileyChris
Mon Sep 28 15:19:46 -0700 2009
| link
and as Rob just pointed out to me, this has already been fixed: http://github.com/robhudson/django-debug-toolbar/commit/97c1240a8fbeb6ed374b94a0bc630bca8a7e1d6b
-
0 comments Created 7 months ago by durin42Debug toolbar can't doesn't re-hide if set up to show/hide with GET paramsdefectxFor some debugging I've been doing, I've found it useful to configure the debug toolbar to only appear when a GET param is present, but then disappear again when a different GET param is present. This doesn't currently work. Fix in my fork at http://github.com/durin42/django-debug-toolbar/tree/master
Comments
-
Explain panel content busts out of frame, not scrollable
1 comment Created 3 months ago by idangazit -
Template context text not wrapped, breaks out of box.
2 comments Created 3 months ago by idangazitComments
2 options here:
- Add overflow:auto to the pre tag. This will add scrollbars when content is wider than the containing space.
- Add white-space:pre-line to the pre tag. This will make the pre wrap.
I don't know which I like better. Option 2 makes it a little better to see everything at once. But I kind of like Option 1 so it doesn't distort the output as you might see it in the console.
- Add overflow:auto to the pre tag. This will add scrollbars when content is wider than the containing space.
-
Settings table header for "value" ridiculously wide
1 comment Created 3 months ago by idangazit -
0 comments Created 6 months ago by loicenhancementxPass context_instance to the toolbar templatesverifiedxIt would be great if the toolbar templates had access to template context processors.
Passing "context_instance=RequestContext(self.request)" to the render_to_string call in "loader.py - render_toolbar()" does the trick.
It makes it easier for anyone who wants to overload the templates and wants for example to change the location of the toolbar media or change how they are served.
Comments
-
0 comments Created 3 months ago by nleushSQL: Show duplicate queries as in SQL Log MiddlewareenhancementxSQL Log Middleware is here: http://www.djangosnippets.org/snippets/344/
Working solution proposition:
Comments
-
3 comments Created 2 months ago by httpdssAdd an "open with editor" featureenhancementxthis feature focuses on adding an icon beside every file path that is displayed by the debug toolbar and by clicking that icon, the file path opens with your default editor.
Comments
i'll start using the txmt:// uri but this can be extended to support any browser/editor
ref: http://blog.macromates.com/2007/the-textmate-url-scheme/
I've been using a
DEBUG_TOOLBAR_CONFIGsetting to specify a default editor and atemplate_editview to actually open the file in the editor. Of course this only works when run locally. I was using TextMate and the txmt:// URLs but I've since switched to Coda, which doesn't have support for opening files via URL.Xdissent, thx 4 the comment! In the discussion with robhudson today he stated that the solution should be editor independent and the use of settings.py should be avoided too. So stay tuned for coda support ;) the idea is to be able to get the value from $EDITOR but its all under planning stage (except for the txmt links, which i will push into my branch later)
cheers!
-
In case someone else wants this and has time before I do:
It'd be really awesome if we collapsed the contents of the context display panel for either huge elements or simply the common boilerplate like context['request']. It seems like this would require manually serializing the context objects so they could be styled - maybe it'd be worth switching entirely to nested
- s, with a jQuery toggle on click?
Comments
Naturally, I posted this just seconds before noticing 1ca31fe. I still think it'd be better to have that information available in some cases but this takes away most of my motivation.
We've replaced both the sql_queries context (if the debug context process in enabled), and the request context with representations, since both of these can be seen in the other panels. This change was added and is now in the 0.8.1 release.
See:
http://github.com/robhudson/django-debug-toolbar/commit/1ca31fe54936d29f15cf23d92b9ab331e5199707Huge elements are a different matter. I wouldn't want to truncate them. But increasing the usability of reading them I agree would be worthwhile.
-
Redirection capture should "|urlencode" the url.
2 comments Created 8 months ago by philzIf you redirect to a URL that needs quoting, clicking on the link in the interstitial page fails.
I've fixed this (trivially) in
http://github.com/philz/django-debug-toolbar/commit/aa07a663cb7b94cf626540112d35f991e5195debThanks!
Comments
-
Toolbar ignores INTERNAL_IPS when run with runserver_plus from django-extensions
0 comments Created 5 months ago by qrilkaI use both django-extensions and django-debug-toolbar. I run runserver_plus on my development machine (and thus use werkzeug debugger) and when I access any page on my webserver from the outside I get page with bottom filled with diferent info from debug-toolbar (though toolbar css doesn't work).
Comments
-
Using Mingus blog engine, the Debug tool bar displays on all pages except added Flatpages.. I'm new to this so it could be me.
Comments
No, it's not you. The issue is flatpages use a middleware to catch a 404 and see if there's a flatpage for that URL. Other middlewares (read: debug toolbar middleware) isn't run on the resulting response. A variation of this is tracked in Django http://code.djangoproject.com/ticket/6094
I am able to see django debug panel even on flatpages. Maybe the issue is with middleware order? DebugToolbarMiddleware should be before FlatpageFallbackMiddleware as any other middleware. It is easy to oversight this if some variation of "local_settings.py" pattern is used.
Big help, Put the Django toolbar in 1st on Middlewareclasses, now it works fine all over
-
0 comments Created 7 months ago by anderserdefectxUnicode Error using ISO-8859-1 as default_charsetverifiedxSeems the rendering of the toolbar crashes when default_charset="iso-8859-1" in settings.py.
----Snipp---------------
Traceback (most recent call last):
File "c:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 278, in run
self.result = application(self.environ, self.start_response)File "c:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 635, in call
return self.application(environ, start_response)File "c:\Python25\lib\site-packages\django\core\handlers\wsgi.py", line 245, in call
response = middleware_method(request, response)File "c:\Python25\lib\site-packages\django_debug_toolbar-0.7.0-py2.5.egg\debug_toolbar\middleware.py", line 93, in process_response
response.content = replace_insensitive(smart_unicode(response.content), u'</body>', smart_unicode(self.debug_toolbar.render_toolbar() + u'</body>'))File "c:\Python25\lib\site-packages\django\utils\encoding.py", line 42, in smart_unicode
return force_unicode(s, encoding, strings_only, errors)File "c:\Python25\lib\site-packages\django\utils\encoding.py", line 77, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)DjangoUnicodeDecodeError: 'utf8' codec can't decode bytes in position 4432-4434: invalid data. You passed in '\n\n\n\n\n\n<!DOblablablab (my iso-8859-1 encoded page with lots of nordic characters like æøå)
--------end snippet---------
The debug toolbar works if default_charset is set to "utf-8", but that is not an option for me...
Comments
-
0 comments Created 3 months ago by olivergeorgeShow modified context for templates invoked with a with clauseenhancementxI'm not seeing "field" in the context displayed for the included template. Not sure if with really modifies the context but it'd be good if this was visible when debugging.
{% with form.fullname as field %} {% include "project/field-snippet.html" %} {% endwith %}Comments
-
Crash while rendering value of {{block.super}} variable
1 comment Created 5 months ago by kmikeDebug toolbar crashes with TemplateDebugPanel enabled when there is a {{ block.super }} variable in template and django template filters with unicode parameters are used in super-block.
Debug toolbar tries to render this {{ block.super }} variable using
pformat. But it fails for Django template variables when there is unicode data to show as django.template.Variable class have only str method, not unicode. I think it's more Django bug than debug toolbar bug, but to work-around it here is more simple as it does not affect anything but django-debug-toolbar.The patched version can be found in my fork (http://github.com/kmike/django-debug-toolbar ).
Comments
-
Comments
-
You can check it here:
http://github.com/kmike/django-debug-toolbar/tree/ui-rf-locale_ruPlease note that I also mark a couple of strings in templates and code as translateble.
Comments
-
1 comment Created about 1 month ago by kmikedefectxNew Request Vars panel with view arguments raises exception when view kwargs contain object that can't be unicodedverifiedxMy case was passing custom form class to login view. The solution can be the same we've done with context (bypass objects with broken unicode) but with this solution we'll hide some view arguments.
Full traceback:
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)File "/opt/local/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 651, in call
return self.application(environ, start_response)File "/opt/local/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 245, in call
response = middleware_method(request, response)File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/debug_toolbar/middleware.py", line 91, in process_response
response.content = replace_insensitive(smart_unicode(response.content), u'</body>', smart_unicode(self.debug_toolbars[request].render_toolbar() + u'</body>'))File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/debug_toolbar/toolbar/loader.py", line 72, in render_toolbar
'BASE_URL': self.request.META.get('SCRIPT_NAME', ''),File "/opt/local/lib/python2.5/site-packages/django/template/loader.py", line 108, in render_to_string
return t.render(context_instance)File "/opt/local/lib/python2.5/site-packages/django/test/utils.py", line 29, in instrumented_test_render
return self.nodelist.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 779, in render
bits.append(self.render_node(node, context))File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_node
result = node.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/defaulttags.py", line 155, in render
nodelist.append(node.render(context))File "/Users/kmike/dev/tur/smart_tags/templatetags/smart_if.py", line 213, in render
return self.nodelist_true.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 779, in render
bits.append(self.render_node(node, context))File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_node
result = node.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 87, in render
output = force_unicode(self.filter_expression.resolve(context))File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 546, in resolve
obj = self.var.resolve(context)File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 687, in resolve
value = self._resolve_lookup(context)File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 722, in _resolve_lookup
current = current()File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/debug_toolbar/panels/request_vars.py", line 40, in content
return render_to_string('debug_toolbar/panels/request_vars.html', context)File "/opt/local/lib/python2.5/site-packages/django/template/loader.py", line 108, in render_to_string
return t.render(context_instance)File "/opt/local/lib/python2.5/site-packages/django/test/utils.py", line 29, in instrumented_test_render
return self.nodelist.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/init.py", line 779, in render
bits.append(self.render_node(node, context))File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 81, in render_node
raise wrappedTemplateSyntaxError: Caught an exception while rendering: unbound method unicode() must be called with EmailAuthenticationForm instance as first argument (got nothing instead)
Original Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_noderesult = node.render(context)File "/opt/local/lib/python2.5/site-packages/django/template/defaulttags.py", line 155, in render
nodelist.append(node.render(context))File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 87, in render
output = force_unicode(self.filter_expression.resolve(context))File "/opt/local/lib/python2.5/site-packages/django/utils/encoding.py", line 71, in force_unicode
s = unicode(s)TypeError: unbound method unicode() must be called with EmailAuthenticationForm instance as first argument (got nothing instead)
Comments
-
Templates panel is empty when django-flatblocks app is used.
4 comments Created about 1 month ago by kmikeThis happens because django-flatblocks' template tag {% flatblock %} passes RequestContext object to rendered template and debug toolbar thinks it is a context layer. Exception is raised because RequestContext doesn't have 'items' attribute and then the exception is hided somewhere, but the Templates panel becomes absolutely empty.
The simple fix (introduced in my fork) is to check if context layer has an 'items' attribute before pre-processing. All information for flatblock's RequestContext object is readable but unformatted with this fix.
It seems that django-flatblocks behaviour is valid because all template variables passed in it's way are available in the template.
The other possible way to fix this problem is to use recursion but I think it's an overkill.
Comments
This behaviour (empty Template panel) also occurs with django-cms-2.0
Can you please check if the problem is the same and the solution is working?
Yes I can confirm that kmike@6d01b70 fixes the problem in my case
-
3 comments Created 5 months ago by delfickurlpatterns multply when toolbar is enableddefectxWhen the debug toolbar is enabled, then the urlpatterns are multiplied everytime a request is made.
I tested this by setting debug to True and entering an address that I don't have a pattern for. Every time I refresh the page, the urlpatterns increases.
If I do the same but with the debug toolbar disabled, then the urlpatterns does not increase.
to demonstrate visually:
what it should lok like : http://delfick.test.googlepages.com/urlpatterns.png
what it looks like after a refresh : http://delfick.test.googlepages.com/urlpatterns2.png
(and for every refresh it increases)...
Comments
Which version are you using? That was a bug I thought we fixed some time ago.
I just updated to the latest git and it's still there.....
I decided to look into this further and found a fix.... I'm not sure how to add files to these comments, but you can find a patch of my fix here http://delfick.test.googlepages.com/debug_toolbar_urls.patch
-
deleteme please, wrong bugtracker - sorry for the confusion
1 comment Created 2 months ago by bzed -
I have a manager that takes 'name' and performs the following:
SELECT year as y FROM data_locations WHERE year IS NOT NULL AND name='%(name)s' GROUP BY y ORDER BY y ASCWhen name=niederösterreich I get a UnicodeEncodeError caused by line 108 of panels/sql.py:
'hash': sha_constructor(settings.SECRET_KEY + sql + _params).hexdigest(),
Note, the query works without the debug toolbar installed
Comments
-
0 comments Created 3 months ago by timmolendijk"RuntimeError: request object has expired"defectx[Tue Sep 22 22:04:43 2009] [info] [client 127.0.0.1] mod_wsgi (pid=45241, process='perslijst.smartpr', application=''): Loading WSGI script '/Users/tim/Sites/smartpr/perslijst/parts/smartpr.wsgi.app/wsgi'. [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] mod_wsgi (pid=45241): Exception occurred processing WSGI script '/Users/tim/Sites/smartpr/perslijst/parts/smartpr.wsgi.app/wsgi'. [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] Traceback (most recent call last): [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/core/handlers/wsgi.py", line 243, in __call__ [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] response = middleware_method(request, response) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/Users/tim/Sites/smartpr/perslijst/parts/django-debug-toolbar.pkg/debug_toolbar/middleware.py", line 93, in process_response [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] response.content = replace_insensitive(smart_unicode(response.content), u'</body>', smart_unicode(self.debug_toolbar.render_toolbar() + u'</body>')) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/Users/tim/Sites/smartpr/perslijst/parts/django-debug-toolbar.pkg/debug_toolbar/toolbar/loader.py", line 72, in render_toolbar [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] 'BASE_URL': self.request.META.get('SCRIPT_NAME', ''), [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/loader.py", line 107, in render_to_string [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] return t.render(context_instance) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/test/utils.py", line 15, in instrumented_test_render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] return self.nodelist.render(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/__init__.py", line 768, in render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] bits.append(self.render_node(node, context)) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/debug.py", line 71, in render_node [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] result = node.render(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/defaulttags.py", line 148, in render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] nodelist.append(node.render(context)) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/defaulttags.py", line 245, in render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] return self.nodelist_true.render(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/__init__.py", line 768, in render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] bits.append(self.render_node(node, context)) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/debug.py", line 81, in render_node [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] raise wrapped [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] TemplateSyntaxError: Caught an exception while rendering: request object has expired [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] Original Traceback (most recent call last): [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/debug.py", line 71, in render_node [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] result = node.render(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/debug.py", line 87, in render [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] output = force_unicode(self.filter_expression.resolve(context)) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/__init__.py", line 535, in resolve [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] obj = self.var.resolve(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/__init__.py", line 676, in resolve [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] value = self._resolve_lookup(context) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/template/__init__.py", line 711, in _resolve_lookup [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] current = current() [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/Users/tim/Sites/smartpr/perslijst/parts/django-debug-toolbar.pkg/debug_toolbar/panels/request_vars.py", line 26, in content [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] 'post': [(k, self.request.POST.getlist(k)) for k in self.request.POST.iterkeys()], [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/core/handlers/wsgi.py", line 169, in _get_post [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] self._load_post_and_files() [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/core/handlers/wsgi.py", line 149, in _load_post_and_files [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] self._post, self._files = http.QueryDict(self.raw_post_data, encoding=self._encoding), datastructures.MultiValueDict() [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/core/handlers/wsgi.py", line 203, in _get_raw_post_data [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] size=content_length) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] File "/usr/local/share/buildout/eggs/Django-1.0.2_final-py2.5.egg/django/core/handlers/wsgi.py", line 69, in safe_copyfileobj [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] buf = fsrc.read(min(length, size)) [Tue Sep 22 22:04:44 2009] [error] [client 127.0.0.1] RuntimeError: request object has expiredComments
-
Enhancement:
It would be really handy if the debug toolbar could tell me:
1) which urlconfs were used to arrive at the current view
2) which view was rendered, and with what argumentsThis is especially useful when you have a lot of apps, each with their own urlconf, and you don't immediately know which app owns the url pattern that was just matched, or which app owns the view that was rendered as a result. The url pattern and the view it matches may be in different apps, and there may have been several include()s before this urlpattern was reached.
I see you already tell us which template was chosen, which is nice.
Comments
-
1 comment Created about 1 month ago by zgoda0.8.1 breaks Python 2.4 compatibilityverifiedx -
Any plans for jinja2 templates support?
dcramer fork support jinja2, but they have some annoying features and bugs (remote javascript loading from google, random crashes with apache+mod_wsgi, jquery 1.3.2 compatibility problems, etc..)Comments
-
0 comments Created about 1 month ago by raphjikProposal (with patch): new Tidy panelenhancementxA new panel which displays tidy html errors and warning on current page
(requires python-utidylib but degrades nicely if the library is not available on python system path)
git patch against current master : http://bit.ly/4pVmAW
Comments
-
The request context vars set by the template tag aren't seen
1 comment Created about 1 month ago by arthur78I have a template tag which adds to the context some additional variables. When I go to the Templates panel and click Toggle Context, those new variables are not listed.
(debug_toolbar-0.7.0-py2.5)
Comments
-
The part of the tests that have to do with the admin break with the toolbar enabled. The test failure log is exactly the same as in the django ticket 9095: http://code.djangoproject.com/ticket/9095
To reproduce in an arbitrary project:
Turn debug toolbar off Run manage.py test -> Tests succeed Turn debug toolbar on Run manage.py test -> Tests failComments
-
it is really annoying to always have errors because of debug-toolbar.
The corrections are really small to be XHTML compliant :
<br> => <br/> correct closing of <pre> in sql.html & => & between parameters in hrefs of sql.html include <style> in <head> replace href="" by href="#" for "close" and "back" links avoid empty span for djDebugLineChart in sql.htmlComments






This panel is implemented here: http://github.com/alex/django-debug-toolbar/tree/signal-panel
Fixed here.
Oh yeah. Thanks Alex!