Git Product home page Git Product logo

django-debug-toolbar's Introduction

Django Debug Toolbar Latest version on PyPI

Jazzband Build Status Test coverage status Documentation status Supported Python versions Supported Django versions

The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel's content.

Here's a screenshot of the toolbar in action:

Django Debug Toolbar screenshot

In addition to the built-in panels, a number of third-party panels are contributed by the community.

The current stable version of the Debug Toolbar is 4.4.2. It works on Django ≥ 4.2.0.

The Debug Toolbar does not currently support Django's asynchronous views.

Documentation, including installation and configuration instructions, is available at https://django-debug-toolbar.readthedocs.io/.

The Django Debug Toolbar is released under the BSD license, like Django itself. If you like it, please consider contributing!

The Django Debug Toolbar was originally created by Rob Hudson <[email protected]> in August 2008 and was further developed by many contributors.

django-debug-toolbar's People

Contributors

aaugustin avatar acdha avatar adamchainz avatar alex avatar auvipy avatar bkonkle avatar dcramer avatar folt avatar graingert avatar hramezani avatar jasonkeene avatar jdufresne avatar jezdez avatar kmike avatar lamby avatar living180 avatar matthiask avatar nikolas avatar nuklea avatar orcasrob avatar pauloxnet avatar percyperez avatar pre-commit-ci[bot] avatar robhudson avatar samuelcolvin avatar singingwolfboy avatar tim-schilling avatar timgraham avatar xi avatar yml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-debug-toolbar's Issues

Django admin tests break

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 fail

UrlConfs and View Arguments

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 arguments

This 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.

Pass context_instance to the toolbar templates

It 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.

"RuntimeError: request object has expired"

[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 expired

New Request Vars panel with view arguments raises exception when view kwargs contain object that can't be unicoded

My 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'', smart_unicode(self.debug_toolbars[request].render_toolbar() + u''))

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 wrapped

TemplateSyntaxError: 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_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 "/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)

Error when passing UTF8 in manager

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 ASC 

When 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

Crash while rendering value of {{block.super}} variable

Debug 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 ).

Jinja2 templates support

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..)

Add profiling panel

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.

Sub SELECT queries should be idented correctly

  1. What steps will reproduce the problem?
    1. 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_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` ASC
  1. 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` ASC
```

  1. What version of the product are you using? On what operating system?

ea1f9430ddb58f28b50cc702f9eb2612f19e308d

Originally added by overkrik on Google Code.

Python 2.4 compatibility.

It appears to work pretty well on 2.4 except for debug_toolbar/panels/sql.py line 113. Python 2.4 does not support try, except, finally, but needs two seperate try statements. After this change I did not see any issues. Can this be fixed?

Add ability to toggle each panel from the frontend

I 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.

Unicode Error using ISO-8859-1 as default_charset

Seems the rendering of the toolbar crashes when default_charset="iso-8859-1" in settings.py.

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 æøå)

The debug toolbar works if default_charset is set to "utf-8", but that is not an option for me...

Fix caching panel

See notes here: http://code.google.com/p/django-debug-toolbar/issues/detail?id=13

Add a signals panel

It could show all the registered handlers for each of the signals built into django (and probably have a hook for registering custom signals).

Add memory tracking panel

Similar to [Dowser](http://www.aminus.net/browser/dowser), look at implementing a memory tracking panel.

debug-toolbar is not XHTML compliant

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
  • & => &amp; 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.html

Show modified context for templates invoked with a with clause

I'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 %}

urlpatterns multply when toolbar is enabled

When 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)

...

Redirect page does not set cookie

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)

Add an "open with editor" feature

this 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.

Templates panel is empty when django-flatblocks app is used.

This 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.

Improved context display

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.