title: Django: get_absolute_url not working
body: <p>In Django, I want to display a detailed view of model objects by using the get_absolute_url method as described <a href="https://docs.djangoproject.com/en/1.11/ref/models/instances/#get-absolute-url" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The URL structure for each detail is something like this...</p>
  
  <pre><code>url.com/company/(?P&lt; company_id &gt;[0-9]+)/people/(?P&lt; slug &gt;[0-9]+)/$
  </code></pre>
  
  <p>where .../people/ is the list view and the .../people/slug/ is the detail for each object</p>
  
  <p>Which returns the NoReverseMatch error like so</p>
  
  <blockquote>
    <p>NoReverseMatch at /company/google/people/</p>
  </blockquote>
  
  <p>as I put the <code>href='{{ people.get_absolute_url }}'</code> in my template.</p>
  
  <p>Does anybody know if using the 'company_id' kwarg in the URL is causing problems rendering the page with the get_absolute_url href for the 'slug' kwarg?</p>
  
  <p>I've done this many times before with a hardcoded URL before the kwarg variable which worked; such as 'company/people/(?P&lt; slug >[0-9]+)/$' - note there's only one keyword</p>
  
  <p>Full Error:</p>
  
  <blockquote>
    <p>Reverse for 'people-detail' with arguments '()' and keyword arguments
    '{u'slug': u'798224891221678'}' not found. 1 pattern(s) tried:
    ['company/(?P&lt; company_id >[0-9]+)/people/(?P&lt; slug >[0-9]+)/$']</p>
  </blockquote>
  
  <p>get_absolute_url method:</p>
  
  <pre><code>def get_absolute_url(self):
          return reverse('people-detail', kwargs={'slug': self.slug})
  </code></pre>