diff --git a/django/views/debug.py b/django/views/debug.py
index fe44e25..4dfa723 100644
a
|
b
|
class ExceptionReporter:
|
221 | 221 | function = tb.tb_frame.f_code.co_name |
222 | 222 | lineno = tb.tb_lineno - 1 |
223 | 223 | loader = tb.tb_frame.f_globals.get('__loader__') |
224 | | module_name = tb.tb_frame.f_globals.get('__name__') |
| 224 | module_name = tb.tb_frame.f_globals.get('__name__') or '' |
225 | 225 | pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name) |
226 | 226 | if pre_context_lineno is not None: |
227 | 227 | frames.append({ |
228 | 228 | 'tb': tb, |
| 229 | 'type': module_name.startswith('django.') and 'django' or 'user', |
229 | 230 | 'filename': filename, |
230 | 231 | 'function': function, |
231 | 232 | 'lineno': lineno + 1, |
… |
… |
TECHNICAL_500_TEMPLATE = """
|
333 | 334 | table.source th { color:#666; } |
334 | 335 | table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; } |
335 | 336 | ul.traceback { list-style-type:none; } |
336 | | ul.traceback li.frame { margin-bottom:1em; } |
| 337 | ul.traceback li.frame { padding-bottom:1em; } |
| 338 | ul.traceback li.django { background-color: #ffe;} |
| 339 | ul.traceback li.user { background-color: #ffe;} |
337 | 340 | div.context { margin: 10px 0; } |
338 | 341 | div.context ol { padding-left:30px; margin:0 10px; list-style-position: inside; } |
339 | 342 | div.context ol li { font-family:monospace; white-space:pre; color:#666; cursor:pointer; } |
340 | | div.context ol.context-line li { color:black; background-color:#ccc; } |
| 343 | div.context ol.context-line li { color:black; background-color:#fcc; } |
| 344 | .django div.context ol.context-line li { background-color:#cfc; } |
| 345 | .user div.context ol.context-line li { background-color:#fec; } |
341 | 346 | div.context ol.context-line li span { float: right; } |
342 | 347 | div.commands { margin-left: 40px; } |
343 | 348 | div.commands a { color:black; text-decoration:none; } |
… |
… |
TECHNICAL_500_TEMPLATE = """
|
347 | 352 | #template, #template-not-exist { background:#f6f6f6; } |
348 | 353 | #template-not-exist ul { margin: 0 0 0 20px; } |
349 | 354 | #unicode-hint { background:#eee; } |
350 | | #traceback { background:#eee; } |
| 355 | #traceback { background:#ffe; } |
351 | 356 | #requestinfo { background:#f6f6f6; padding-left:120px; } |
352 | 357 | #summary table { border:none; background:transparent; } |
353 | 358 | #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; } |
… |
… |
TECHNICAL_500_TEMPLATE = """
|
504 | 509 | <div id="browserTraceback"> |
505 | 510 | <ul class="traceback"> |
506 | 511 | {% for frame in frames %} |
507 | | <li class="frame"> |
| 512 | <li class="frame {{ frame.type }}"> |
508 | 513 | <code>{{ frame.filename|escape }}</code> in <code>{{ frame.function|escape }}</code> |
509 | 514 | |
510 | 515 | {% if frame.context_line %} |