#NEWLINE# def server_error( request , template_name = '500.html' ) : #NEWLINE# #INDENT# '\n    500 error handler.\n    ' #NEWLINE# domain = ( get_domain_from_url ( request . path ) or '' ) #NEWLINE# t = loader . get_template ( request ) #NEWLINE# ( type , exc , tb ) = sys . exc_info ( ) #NEWLINE# traceback_text = '' . join ( traceback . format_tb ( tb ) ) #NEWLINE# traceback_key = uuid . uuid4 ( ) . hex #NEWLINE# cache . cache . set ( traceback_key , traceback_text , ( 60 * 60 ) ) #NEWLINE# return HttpResponseServerError ( t . render ( RequestContext ( request , { #NEWLINE# #INDENT# 'MEDIA_URL' : settings . MEDIA_URL , #NEWLINE# 'STATIC_URL' : settings . STATIC_URL , #NEWLINE# 'domain' : domain , #NEWLINE# '500traceback' : traceback_key , #NEWLINE# #UNINDENT# } ) ) )