{{{
except: # Handle everything else.
# Get the exception info now, in case another exception is
thrown later.
signals.got_request_exception.send(sender=self.__class__,
request=request)
response = self.handle_uncaught_exception(request, resolver,
sys.exc_info())
}}}
And this haunted me quite a while when I just made a syntax mistake in my
view function. Since I was reported "Server Error 500 27"
Internal Server error. But why?
When I add this block, I find the answer of my error.
{{{
except Exception as e:
import traceback
traceback.print_exc(e)
except: # Handle everything else.
# Get the exception info now, in case another exception is
thrown later.
signals.got_request_exception.send(sender=self.__class__,
request=request)
response = self.handle_uncaught_exception(request, resolver,
sys.exc_info())
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21536>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
It looks to me like you're requesting us to add logging for errors,
however, if you have logging properly setup, `handle_uncaught_exception()`
should log the error. If `DEBUG=True` you should get a colorful error
page.
--
Ticket URL: <https://code.djangoproject.com/ticket/21536#comment:1>