Re: Urgent: django app got internal error: TemplateDoesNotExist: 500.html
It looks to me like you do not have 500.html file in your base template directory. If you have a server error in production mode (DEBUG = False), django will show 500.html to users. So users will not see actual error message. But you will get that message by email. Since you do not have 500.html it gives you template does not exist error instead of actual error message. This will not help you to solve your problem, but at least it will help you identify it. On Dec 19, 9:24 pm, Ashkan Roshanayi wrote: > I tried to live edit base.py template but now my app has internal error. I > undo the changes but still get 500 error while accessing website. Tail -f > of my application_name.log shows: > > > > > > > > > > > > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 108, in __init__ > > self.nodelist = compile_string(template_string, origin) > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 136, in compile_string > > return parser.parse() > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 237, in parse > > self.invalid_block_tag(token, command, parse_until) > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 291, in invalid_block_tag > > raise self.error(token, "Invalid block tag: '%s'" % command) > > TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20' > > And tail -f of error.log shows: > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] return > > > > > > > > > > > callback(request, **param_dict), referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py", > > line 93, in _wrapped_view, referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] response = > > view_func(request, *args, **kwargs), referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py", > > line 30, in server_error, referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] t = > > loader.get_template(template_name) # You need to create a 500.html > > template., referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > > line 157, in get_template, referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] template, > > origin = find_template(template_name), referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > > line 138, in find_template, referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] raise > > TemplateDoesNotExist(name), referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > > TemplateDoesNotExist: 500.html, referer: > >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6... > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] mod_wsgi > > (pid=2688): Exception occurred processing WSGI script > > '/home/jalala/projects/Hamkharid/bin/django.wsgi'. > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] Traceback > > (most recent call last): > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", > > line 272, in __call__ > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] response = > > self.get_response(request) > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > > line 169, in get_response > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] response = > > self.handle_uncaught_exception(request, resolver, sys.exc_info()) > > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.
Re: Urgent: django app got internal error: TemplateDoesNotExist: 500.html
Also, your "undo" may not have been picked up by the app; I would also try restarting your webserver. _Nik On 12/19/2011 11:24 AM, Ashkan Roshanayi wrote: > I tried to live edit base.py template but now my app has internal > error. I undo the changes but still get 500 error while accessing > website. Tail -f of my application_name.log shows: > > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 108, in __init__ > self.nodelist = compile_string(template_string, origin) > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 136, in compile_string > return parser.parse() > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 237, in parse > self.invalid_block_tag(token, command, parse_until) > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 291, in invalid_block_tag > raise self.error(token, "Invalid block tag: '%s'" % command) > TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20' > > > And tail -f of error.log shows: > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > return callback(request, **param_dict), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py", > line 93, in _wrapped_view, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > response = view_func(request, *args, **kwargs), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py", > line 30, in server_error, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] t > = loader.get_template(template_name) # You need to create a > 500.html template., referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > line 157, in get_template, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > template, origin = find_template(template_name), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > line 138, in find_template, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > raise TemplateDoesNotExist(name), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > TemplateDoesNotExist: 500.html, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > mod_wsgi (pid=2688): Exception occurred processing WSGI script > '/home/jalala/projects/Hamkharid/bin/django.wsgi'. > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > Traceback (most recent call last): > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", > line 272, in __call__ > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > response = self.get_response(request) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > line 169, in get_response > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > response = self.handle_uncaught_exception(request, resolver, > sys.exc_info()) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > line 218, in handle_uncaught_exception > [Mon Dec 19
Re: Urgent: django app got internal error: TemplateDoesNotExist: 500.html
It looks like your changes weren't undone correctly, given the "Invalid block tag" error. I would double check that tag, make sure it is correct, and make sure than any required loading is done for that tag to be available to the template. The other error (TemplateDoesNotExist) is really related to the first error: the first error would show a "500" page to the user, but since you don't have a 500.html template defined, you get the "TemplateDoesNotExist" instead. _Nik On 12/19/2011 11:24 AM, Ashkan Roshanayi wrote: > I tried to live edit base.py template but now my app has internal > error. I undo the changes but still get 500 error while accessing > website. Tail -f of my application_name.log shows: > > > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 108, in __init__ > self.nodelist = compile_string(template_string, origin) > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 136, in compile_string > return parser.parse() > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 237, in parse > self.invalid_block_tag(token, command, parse_until) > File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > line 291, in invalid_block_tag > raise self.error(token, "Invalid block tag: '%s'" % command) > TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20' > > > And tail -f of error.log shows: > > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > return callback(request, **param_dict), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py", > line 93, in _wrapped_view, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > response = view_func(request, *args, **kwargs), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py", > line 30, in server_error, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] t > = loader.get_template(template_name) # You need to create a > 500.html template., referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > line 157, in get_template, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > template, origin = find_template(template_name), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > line 138, in find_template, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > raise TemplateDoesNotExist(name), referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > TemplateDoesNotExist: 500.html, referer: > > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > mod_wsgi (pid=2688): Exception occurred processing WSGI script > '/home/jalala/projects/Hamkharid/bin/django.wsgi'. > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > Traceback (most recent call last): > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", > line 272, in __call__ > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] > response = self.get_response(request) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > line 169, in get_response > [Mon Dec 19 13:22:55 20
Urgent: django app got internal error: TemplateDoesNotExist: 500.html
I tried to live edit base.py template but now my app has internal error. I undo the changes but still get 500 error while accessing website. Tail -f of my application_name.log shows: > > > File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 108, in __init__ > self.nodelist = compile_string(template_string, origin) > File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 136, in compile_string > return parser.parse() > File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 237, in parse > self.invalid_block_tag(token, command, parse_until) > File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py", > > line 291, in invalid_block_tag > raise self.error(token, "Invalid block tag: '%s'" % command) > TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20' And tail -f of error.log shows: [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] return > callback(request, **param_dict), referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py", > > line 93, in _wrapped_view, referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] response = > view_func(request, *args, **kwargs), referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py", > > line 30, in server_error, referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] t = > loader.get_template(template_name) # You need to create a 500.html > template., referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > > line 157, in get_template, referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] template, > origin = find_template(template_name), referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py", > > line 138, in find_template, referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] raise > TemplateDoesNotExist(name), referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] > TemplateDoesNotExist: 500.html, referer: > http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107 > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] mod_wsgi > (pid=2688): Exception occurred processing WSGI script > '/home/jalala/projects/Hamkharid/bin/django.wsgi'. > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] Traceback > (most recent call last): > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", > > line 272, in __call__ > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] response = > self.get_response(request) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > > line 169, in get_response > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] response = > self.handle_uncaught_exception(request, resolver, sys.exc_info()) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", > > line 218, in handle_uncaught_exception > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] return > callback(request, **param_dict) > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] File > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py", > > line 93, in _wrapped_view > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] response = > view_func(request, *args, **kwargs) > [Mon Dec 19 13:22:55 2011] [error] [cl