title: Want to show detailview, clicking in a link in a listview
body: <p>I want to show the detail from a school, which will show all the students but when i run the code, it doesnt find the url, i've been searching for the answer all over the web but still dont get it, the point is to show a list of all the schools in a list.html file, that works okay, but when i want to click in an item from that list, it supposed to show the details from that school which will be all the students attending that school, but it returns a 404 error, saying that it didnt find the url.</p>
  
  <pre><code>####MODELS
  
  # Create your models here.
  class School(models.Model):
      name = models.CharField(max_length=256)
      principal = models.CharField(max_length=256)
      location = models.CharField(max_length=256)
  
      def __str__(self):
          return self.name
  
  class Students(models.Model):
      name = models.CharField(max_length=256)
      age = models.PositiveIntegerField()
      school = models.ForeignKey(School,on_delete=models.CASCADE,related_name='students')
  
      def __str__(self):
          return self.name
  
  ####VIEWS
  from django.views.generic import View,DetailView,ListView
  from .models import *
  
  # Create your views here.
  class Index(View):
      def get(self,request):
          return HttpResponse('Hello World')
  
  class SchoolList(ListView):
      model = School
      template_name = 'firstapp/list.html'
      context_object_name = 'School'
  
  class SchoolDetails(DetailView):
      model = School
      template_name = 'firstapp/detail.html'
      context_object_name = 'School_detail'
  
  
  
  ####URLS
  from django.urls import path
  from . import views
  
  urlpatterns = [
      path('list/',views.SchoolList.as_view(),name='list'),
      path('School_detail/&lt;int:pk&gt;',views.SchoolDetails.as_view(),name='details')
  ]
  
  ####LIST HTML
  
  {%extends 'firstapp/base.html'%}
  {%block body_block%}
  
  &lt;h1&gt;Here is a list of the schools!&lt;/h1&gt;
  {%for school in School%}
  &lt;p&gt;&lt;a href="{{school.id}}"&gt;{{school.name}}&lt;/a&gt;&lt;/p&gt;
  {%endfor%}
  {%endblock%}
  
  
  ####DETAIL HTML
  
  {%extends 'firstapp/base.html'%}
  {%block body_block%}
  
  {%for student in school_detail.students.all%}
  &lt;p&gt;{{student.name}}&lt;/p&gt;
  {%endfor%}
  
  {%endblock%}
  </code></pre>