Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1444 closed defect (fixed)

Template debug not working

Reported by: wsobczuk@… Owned by: adrian
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:

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.

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by anonymous

  • Component changed from Admin interface to Template system

comment:2 Changed 8 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 8 years ago by akaihola

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 8 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 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [2906].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.