Skip to content

Commit 960d1cf

Browse files
committed
Merge branch 'master' into js_closure
2 parents ed74a1c + 9327cd8 commit 960d1cf

File tree

16 files changed

+12955
-4
lines changed

16 files changed

+12955
-4
lines changed

debug_toolbar/media/debug_toolbar/toolbar.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
display:block;
134134
font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
135135
white-space:pre;
136-
background-color:#ffffff;
137136
overflow:auto;
138137
}
139138

@@ -169,6 +168,11 @@
169168
height:50px;
170169
}
171170

171+
#djDebug .djDebugPanelTitle code {
172+
display:inline;
173+
font-size:inherit;
174+
}
175+
172176
#djDebug .djDebugPanelContent {
173177
position:absolute;
174178
top:50px;
@@ -225,6 +229,10 @@
225229
padding-right:.5em;
226230
}
227231

232+
#djDebug .djTemplateHideContextDiv {
233+
background-color:#fff;
234+
}
235+
228236
/*
229237
#djDebug .panelContent p a:hover, #djDebug .panelContent dd a:hover {
230238
color:#111;

debug_toolbar/media/debug_toolbar/toolbar.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

debug_toolbar/views.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,30 @@ def template_source(request):
146146
Return the source of a template, syntax-highlighted by Pygments if
147147
it's available.
148148
"""
149-
from django.template.loader import find_template_source
149+
from django.template import TemplateDoesNotExist
150150
from django.utils.safestring import mark_safe
151+
from django.conf import settings
151152

152153
template_name = request.GET.get('template', None)
153154
if template_name is None:
154155
return HttpResponseBadRequest('"template" key is required')
155156

156-
source, origin = find_template_source(template_name)
157+
try: # Django 1.2 ...
158+
from django.template.loader import find_template_loader, make_origin
159+
loaders = []
160+
for loader_name in settings.TEMPLATE_LOADERS:
161+
loader = find_template_loader(loader_name)
162+
if loader is not None:
163+
loaders.append(loader)
164+
for loader in loaders:
165+
try:
166+
source, display_name = loader.load_template_source(template_name)
167+
origin = make_origin(display_name, loader, template_name, settings.TEMPLATE_DIRS)
168+
except TemplateDoesNotExist:
169+
source = "Template Does Not Exist: %s" % (template_name,)
170+
except ImportError: # Django 1.1 ...
171+
from django.template.loader import find_template_source
172+
source, origin = find_template_source(template_name)
157173

158174
try:
159175
from pygments import highlight

example/__init__.py

Whitespace-only changes.

example/example.db

54 KB
Binary file not shown.

example/manage.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python
2+
from django.core.management import execute_manager
3+
try:
4+
import settings # Assumed to be in the same directory.
5+
except ImportError:
6+
import sys
7+
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
8+
sys.exit(1)
9+
10+
if __name__ == "__main__":
11+
execute_manager(settings)

0 commit comments

Comments
 (0)