Opened 19 years ago

Closed 18 years ago

Last modified 18 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: no UI/UX: no

Description

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/basehttp.py", line 272, in run
    self.result = application(self.environ, self.start_response)

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

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

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

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

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

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

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

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

  File "/home/wojtek/django/core/template/defaulttags.py", line 112, in render
    nodelist.append(node.render(context))

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

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

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

TemplateSyntaxError: Caught an exception while rendering.

Change History (5)

comment:1 by anonymous, 19 years ago

Component: Admin interfaceTemplate system

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

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 by Antti Kaihola, 19 years ago

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 by jim-django@…, 19 years ago

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 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

Fixed in [2906].

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