Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1444 closed defect (fixed)

Template debug not working

Reported by: wsobczuk@… Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: nesh@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


here is an exception I got when running with template_debug and debug set to true.
no debug info, no idea what's wrong, etc.

Traceback (most recent call last):

  File "/home/wojtek/django/core/servers/", line 272, in run
    self.result = application(self.environ, self.start_response)

  File "/home/wojtek/django/core/servers/", line 615, in __call__
    return self.application(environ, start_response)

  File "/home/wojtek/django/core/handlers/", line 159, in __call__
    response = self.get_response(request.path, request)

  File "/home/wojtek/django/core/handlers/", line 109, in get_response
    return self.get_technical_error_response(request)

  File "/home/wojtek/django/core/handlers/", line 139, in get_technical_error_response
    return debug.technical_500_response(request, *sys.exc_info())

  File "/home/wojtek/django/views/", line 126, in technical_500_response
    return HttpResponseServerError(t.render(c), mimetype='text/html')

  File "/home/wojtek/django/core/template/", line 146, in render
    return self.nodelist.render(context)

  File "/home/wojtek/django/core/template/", line 714, in render
    bits.append(self.render_node(node, context))

  File "/home/wojtek/django/core/template/", line 732, in render_node
    result = node.render(context)

  File "/home/wojtek/django/core/template/", line 112, in render

  File "/home/wojtek/django/core/template/", line 179, in render
    return self.nodelist_true.render(context)

  File "/home/wojtek/django/core/template/", line 714, in render
    bits.append(self.render_node(node, context))

  File "/home/wojtek/django/core/template/", line 742, in render_node
    raise wrapped

TemplateSyntaxError: Caught an exception while rendering.

Change History (5)

comment:1 Changed 12 years ago by anonymous

Component: Admin interfaceTemplate system

comment:2 Changed 12 years ago by Nebojsa Djordjevic <nesh at studioquattro dot co dot yu>

Cc: nesh@… added

This is a old problem, if you use TEMPLATE_DEBUG=False you will get real exception.

Is there any plans for fixing this?

comment:3 Changed 12 years ago by Antti Kaihola

In my experience, if there an exception is raised in a custom template tag, you'll always get a similar traceback as above, no matter what your debug settings are.

comment:4 Changed 12 years ago by jim-django@…

I see this sort of thing when I get an exception inside the exception template. It's tough to track down where the real exceptionis.

Django catches exceptions in templates and then raises new ones, which means that all exceptions look the same and don't have the real traceback attached. Or, at least, that's how it seems. When I get these problems I go in and remove the "raise wrapped" and make it simply re-raise the original exception, which provides a lot more information.

comment:5 Changed 12 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

Fixed in [2906].

Note: See TracTickets for help on using tickets.
Back to Top