#1444 closed defect (fixed)
Template debug not working
Reported by: | 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 , 19 years ago
Component: | Admin interface → Template system |
---|
comment:2 by , 19 years ago
Cc: | added |
---|
comment:3 by , 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 , 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.
This is a old problem, if you use TEMPLATE_DEBUG=False you will get real exception.
Is there any plans for fixing this?