@never_cache
def handle404(request):    
    # This code is modified from views/debug.py in Django, as we want to display
    # a debug style view, just modified slightly.
    exc_info = sys.exc_info()
    exception = exc_info[1]
    
    try:
        tried = exception.args[0]['tried']
    except (IndexError, __HOLE__, KeyError):
        tried = []

    urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
    if isinstance(urlconf, types.ModuleType):
        urlconf = urlconf.__name__

    c = Context({
        'urlconf': urlconf,
        'root_urlconf': settings.ROOT_URLCONF,
        'request_path': request.path_info[1:], # Trim leading slash
        'urlpatterns': tried,
        'reason': force_bytes(exception, errors='replace'),
        'request': request,
        'settings': get_safe_settings(),
    })
    
    return HttpResponseNotFound(render_to_string('splunkdj:404.html', context_instance=c))
dataset/ETHPy150Open splunk/splunk-webframework/server/splunkdj/views.py/handle404