Django Debugging Helper
I found this to be extremely helpful inside my django source to aid in debugging Ajax and other server 500 errors. At the bottom of this function add the following lines:
def technical_500_response(request, exc_type, exc_value, tb):
"""
Create a technical server error response. The last three arguments are
the values returned from sys.exc_info() and friends.
"""
# ... skip to the end of the function
print '-' * 80
print ' 500 Exception', c['exception_type'], c['exception_value']
print ' url:', request.path, '\n'
for fr in [ frames[i] for i in range( len(frames)-1, 0, -1 ) ]:
print ' trace: [%5s] %-20s in %s' % (fr['lineno'] , fr['function'], fr['filename'] )
print '-' * 80
return HttpResponseServerError(t.render(c), mimetype='text/html')
Apr 22nd 2008
you should submit this as a patch to get it into trunk on django