#NEWLINE# def process_exception( self , request , exception ) : #NEWLINE# #INDENT# if ( not isinstance ( exception , DatabaseWriteDenied ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# if getattr ( settings , 'DB_READ_ONLY_MIDDLEWARE_MESSAGE' , False ) : #NEWLINE# #INDENT# from django.contrib import messages #NEWLINE# messages . error ( self , getattr ( settings , 'DB_READ_ONLY_ERROR_MESSAGE' , 'The site is currently in read-only mode. Please try editing later.' ) ) #NEWLINE# #UNINDENT# return HttpResponseReload ( request ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponse ( getattr ( settings , 'DB_READ_ONLY_ERROR_MESSAGE' , 'The site is currently in read-only mode. Please try again later.' ) )