      t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
      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(),
      })
 
</s> remove                     sub_tried = e.args[0].get('tried')
 </s> add                     sub_tried = e.tried </s> remove         tried = exception.args[0]['tried']
    except (IndexError, TypeError, KeyError):
 </s> add         tried = exception.tried
        error_url = exception.path
    except AttributeError: </s> remove             raise Resolver404({'tried': tried, 'path': new_path})
        raise Resolver404({'path': path})
 </s> add             raise Resolver404(new_path, tried=tried)
        raise Resolver404(path) </s> remove             self.assertTrue('tried' in e.args[0])
            tried = e.args[0]['tried']
            self.assertEqual(len(e.args[0]['tried']), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(e.args[0]['tried'])))
            for tried, expected in zip(e.args[0]['tried'], url_types_names):
 </s> add             self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
        'request_path': error_url,
      t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
      c = Context({
          'urlconf': urlconf,
          'root_urlconf': settings.ROOT_URLCONF,
        'request_path': error_url,
          'urlpatterns': tried,
          'reason': force_bytes(exception, errors='replace'),
          'request': request,
          'settings': get_safe_settings(),
      })
keep keep keep keep replace keep keep keep keep keep
 Fixed #18373 - improved handling of Resolver404s from views

When django.core.urlresolvers.resolve was called from a view, failed
and the exception was propagated and rendered by technical_404_response,
the URL mentioned on the page was the current URL instead of the URL
passed to resolve().

Fixed by using the path attribute from the Resolver404 exception instead
of request.path_info. Also cleaned up the exceptions to use standard
named parameters instead of stuffing a dict in args[0] 
django/views/debug.py