title: Link to a different view's template from one template Django
body: <p><a href="https://i.stack.imgur.com/XwhnX.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>I have a template that displays a detail of a dorm with a list of "room_numbers".</p>
  
  <p>The problem:<br/>
  I am trying to make "room_numbers" as a link to each specific dorm room details page (see screenshot above). A dorm room details page has the following format: <em>rooms/&lt;int:pk&gt;</em> as specified in my urls.py</p>
  
  <p>I have scoured through the web and can't find where I need to start. Django and Python newbie here so please bear with me.</p>
  
  <p>URLs.py > </p>
  
  <pre><code>urlpatterns = [
      path('', views.index, name='index'),
      path('list/', views.DormsListView.as_view(), name='dorms'),
      path('list/&lt;int:pk&gt;', views.DormsDetailView.as_view(), name='dorm-detail'),
      path('rooms/', views.DormsRoomView.as_view(), name='rooms'),
      path('rooms/&lt;int:pk&gt;', views.DormsRoomsDetailView.as_view(), name='rooms-detail'),
   ]
  </code></pre>
  
  <p>Views.py (DormsDetailView) ></p>
  
  <pre><code>class DormsDetailView(LoginRequiredMixin, generic.DetailView):
      model = Dorm
  
      def get_context_data(self, *args, **kwargs):
          context = super().get_context_data(*args, **kwargs)
          context['room_numbers'] = ", ".join(self.object.dormroom_set.values_list('room_number', flat=True))
          return context
  </code></pre>
  
  <p>Views.py (DormRoomsDetailView) ></p>
  
  <pre><code>class DormsRoomsDetailView(LoginRequiredMixin, generic.DetailView):
      model = DormRoom
  </code></pre>
  
  <p>Dorm_Detail.html ></p>
  
  <pre><code>&lt;div&gt;Rooms: {{ room_numbers }}&lt;/div&gt;
  </code></pre>