nl: of the request.META dictionary is contained in settings.INTERNAL_IPS, otherwise use string 'EXTERNAL', and result of the method record.getMessage. call the function get_exception_reporter_filter with an argument request, substitute the result for filter.
code: filter = get_exception_reporter_filter ( request )