          error_url = exception.path
      except AttributeError:
          tried = []
      else:
          if (not tried                           # empty URLconf
              or (request.path == '/'
                  and len(tried) == 1             # default URLconf
                  and len(tried[0]) == 1
                  and getattr(tried[0][0], 'app_name', '') == getattr(tried[0][0], 'namespace', '') == 'admin')):
 
</s> remove         tried = exception.args[0]['tried']
    except (IndexError, TypeError, KeyError):
 </s> add         tried = exception.tried
        error_url = exception.path
    except AttributeError: </s> remove                     sub_tried = e.args[0].get('tried')
 </s> add                     sub_tried = e.tried </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): </s> remove         'request_path': request.path_info[1:],  # Trim leading slash
 </s> add         'request_path': error_url,
        error_url = request.path_info[1:] # Trim leading slash
          error_url = exception.path
      except AttributeError:
          tried = []
        error_url = request.path_info[1:] # Trim leading slash
      else:
          if (not tried                           # empty URLconf
              or (request.path == '/'
                  and len(tried) == 1             # default URLconf
                  and len(tried[0]) == 1
                  and getattr(tried[0][0], 'app_name', '') == getattr(tried[0][0], 'namespace', '') == 'admin')):
keep keep add keep 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