#12269 closed (invalid)
exception instead of 404 in production (non-debug) mode
Reported by: | tier | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Django version 1.2 pre-alpha SVN-11782
While querying wrong URL on the development server (having DEBUG = False) Django outputs the same:
Traceback (most recent call last): File "/home/tier/src/django/django/core/servers/basehttp.py", line 279, in run self.result = application(self.environ, self.start_response) File "/home/tier/src/django/django/core/servers/basehttp.py", line 651, in __call__ return self.application(environ, start_response) File "/home/tier/src/django/django/core/handlers/wsgi.py", line 241, in __call__ response = self.get_response(request) File "/home/tier/src/django/django/core/handlers/base.py", line 129, in get_response return self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/home/tier/src/django/django/core/handlers/base.py", line 177, in handle_uncaught_exception return callback(request, **param_dict) File "/home/tier/src/django/django/views/defaults.py", line 23, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "/home/tier/src/django/django/template/loader.py", line 81, in get_template source, origin = find_template_source(template_name) File "/home/tier/src/django/django/template/loader.py", line 74, in find_template_source raise TemplateDoesNotExist, name TemplateDoesNotExist: 500.html
This traceback text is seen in browser and in console as well.
Note:
See TracTickets
for help on using tickets.
First, fix the problem noted in the exception:
# You need to create a 500.html template.
Until you do that you won't be able to track down the underlying problem, which is whatever led to the server looking for the 500.html template in the first place. (Though, if you don't have a 500.html template it might be as simple as not having a 404.html template either.) There are no defaults for these, you need to supply them.