def __init__(self, text, with_trace=False): if with_trace: trace = [ (i[:i.index(',')], i[i.index(','):]) for i in traceback.format_stack()] trace = "<br>".join( ["%s<small>%s</small>"%(a,b) for a,b in trace] ) text = "%s. Please notify the developer."%text content = template %("Server Error", text, trace) else: content = template %("Server Error", text, '') HttpResponseServerError.__init__(self, content)
def __init__(self, content): HttpResponseServerError.__init__(self, content, content_type="text/javascript")
def __init__(self, content): HttpResponseServerError.__init__( self, content, content_type="text/javascript")