Django got an unexpected keyword argument 'id'
<p>I'm trying to create a phonebook in Django.
My urls.py:</p>

<pre><code>    urlpatterns = [
    url(r'^$', views.people_list, name='people_list'),
    url(r'^(?P&lt;id&gt;\d)/$', views.person_detail, name='person_detail'),
]
</code></pre>

<p>views.py:</p>

<pre><code>def people_list(request):
    people = Person.objects.all()
    return render(request, 'phonebook/person/list.html', {'people': people})


def person_detail(request, person):
    person = get_object_or_404(Person, id=person)
    return render(request, 'phonebook/person/detail.html', {'person': person})
</code></pre>

<p>from models.py:</p>

<pre><code>def get_absolute_url(self):
    return reverse('phonebook:person_detail', args=[self.id])
</code></pre>

<p>and list.html:</p>

<pre><code>{% block content %}
&lt;h1&gt;Phonebook&lt;/h1&gt;
{% for person in people %}
&lt;h2&gt;
    &lt;a href="{{ person.get_absolute_url }}"&gt;
        {{ person.name }} {{ person.last_name }}
    &lt;/a&gt;
&lt;/h2&gt;
&lt;p class="where"&gt;
{{ person.department }}, {{ person.facility }}
    &lt;/p&gt;
{{ person.phone1 }}&lt;br&gt;
{% endfor %}
{% endblock %}
</code></pre>

<p>The index looks ok but when I try click on links to get person_detail site I get this message:</p>

<blockquote>
  <p>TypeError at /phonebook/4/
  person_detail() got an unexpected keyword argument 'id'
  Request Method:   GET Request
  URL:  <a href="http://127.0.0.1:8000/phonebook/4/" rel="noreferrer">http://127.0.0.1:8000/phonebook/4/</a> Django Version:  1.9.6
  Exception Type:   TypeError Exception Value:   person_detail() got an
  unexpected keyword argument 'id'</p>
</blockquote>

<p>I have and 'id' argument in urls.py and in function to get_absolute_url. I don't understand what's wrong.</p>