def technical_404_response(request, exception):
 try:
  tried = exception.args[0]['tried']
 except (IndexError, TypeError, KeyError):
  tried = []
 else:
  if (not tried):
   return empty_urlconf(request)
 urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
 if isinstance(urlconf, types.ModuleType):
  urlconf = urlconf.__name__
 t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
 c = Context({'urlconf': urlconf, 'root_urlconf': settings.ROOT_URLCONF, 'request_path': request.path_info[1:], 'urlpatterns': tried, 'reason': smart_str(exception, errors='replace'), 'request': request, 'settings': get_safe_settings()})
 return HttpResponseNotFound(t.render(c), mimetype='text/html')

def technical_404_response ( request , exception ) : try : tried = exception . args [ 0 ] [ 'tried' ] except ( IndexError , TypeError , KeyError ) : tried = [ ] else : if ( not tried ) : return empty_urlconf ( request ) urlconf = getattr ( request , 'urlconf' , settings . ROOT_URLCONF ) if isinstance ( urlconf , types . ModuleType ) : urlconf = urlconf . __name__ t = Template ( TECHNICAL_404_TEMPLATE , name = 'Technical 404 template' ) c = Context ( { 'urlconf' : urlconf , 'root_urlconf' : settings . ROOT_URLCONF , 'request_path' : request . path_info [ 1 : ] , 'urlpatterns' : tried , 'reason' : smart_str ( exception , errors = 'replace' ) , 'request' : request , 'settings' : get_safe_settings ( ) } ) return HttpResponseNotFound ( t . render ( c ) , mimetype = 'text/html' )
create a technical 404 error response .