title: dynamic urls are routing to the same view Django
body: <p>I'm trying to add two links. The first one leads from the dashboard to a profile page and the second one leads from the profile to a comment page for that profile. Instead of doing this, both links are leading to the same urlpattern(add_comment).</p>
  <p>I understand it's happening because they have the same variables and it's only picking the first match but I don't know how to correct it.</p>
  <p>In my <strong>path.py</strong> I have this:</p>
  <pre><code>urlpatterns = [
      path('', views.home, name='home'),
      path('dashboard.html', views.dashboard, name='dashboard'),
      path('&lt;int:person_id&gt;', views.add_comment, name='add_comment'),
      path('&lt;int:person_id&gt;', views.person_profile, name='person_profile'),
      path('logout.html', views.logout_view, name='logout'),
  </code></pre>
  <p>and these are <strong>the templates</strong>:</p>
  <pre><code>THE DASHBOARD TEMPLATE TO LEAD TO THE PROFILE
  
  {% extends &quot;blog/base.html&quot; %}
      {% block content %}
          {% for person in person_list %}
              &lt;a href=&quot;{% url 'account:person_profile' person.id %}&quot;&gt;{{ person }}&lt;/a&gt;
          {% endfor %} 
      {% endblock content %}
  </code></pre>
  <pre><code>THE PROFILE TEMPLATE TO LEAD TO THE ADD_COMMENT
  
  {% extends &quot;blog/base.html&quot; %}
      {% block content %}
          &lt;a href= &quot;{% url 'account:add_comment' person.id %}&quot;&gt;Add comment&lt;/a&gt;
      {% endblock content %}
  </code></pre>