title: Django: method not allowed (POST)
body: <p>I have models for classrooms and students, and I'm using a form to select a classroom to show a list of students.  However, when I submit the form on <code>block_list.html</code> and try to go to the view for the student list in <code>random_list.html</code>, I get a <code>method not allowed (POST)</code>.</p>
  
  <p>block_list.html:
  TESTt</p>
  
  <pre><code>&lt;form action="{% url 'classroom:random' %}" method="post"&gt;
      {% csrf_token %}
          &lt;select name="class_block"&gt;
              {% for room in class_list %}
                  &lt;option value={{ room.id }}&gt;{{ room.get_course_block_display }}&lt;/option&gt;
              {% endfor %}
          &lt;/select&gt;
          &lt;input type="submit" value="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>random_list.html:</p>
  
  <pre><code>{% for s in object_list %}
      &lt;ul&gt;
          &lt;li&gt;{{ s.nickname }}&lt;/li&gt;
      &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>app_name = "classroom"
  urlpatterns = [
      url(r'^$', views.index, name='index'),
      url(r'^submitted', views.submitted, name='submitted'),
      url(r'^classup/$', create_classroom_view, name='classroom'),
      url(r'^block/$', views.block, name='block'),
      url(r'^random/$', list_random_view, name='random'),
      # url(r'^(?P&lt;pk&gt;[0-9]+)/$', detail_classroom_view, name='random'),
  ]
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>class RandomListView(ListView):
      model = Student
      template_name = 'classroom/random_list.html'
  
      def get_context_data(self, **kwargs):
          context = super(RandomListView, self).get_context_data(**kwargs)
          students = Student.objects.all()
          # students = Student.objects.filter(classroom__course_block = '24')
          print (students)
          context['students'] = students
          return context
  
  list_random_view = RandomListView.as_view()
  
  def block(request):
      class_list = Classroom.objects.all()
      template = loader.get_template('classroom/block_list.html')
      context ={ 'class_list' : class_list, }
      return HttpResponse(template.render(context, request))
  </code></pre>
  
  <p>models.py:</p>
  
  <pre><code>class Classroom(models.Model):
      COURSE_NAME = (
          ('MA8', 'Math 8'),
          ('SC10', 'Science 10'),
          ('PH11', 'Physics 11'),
          ('PH12', 'Physics 12'),
      )
      BLOCK_NUMBER = (
          ('11', 'Block 1-1'),
          ('12', 'Block 1-2'),
          ('13', 'Block 1-3'),
          ('14', 'Block 1-4'),
          ('21', 'Block 2-1'),
          ('22', 'Block 2-2'),
          ('23', 'Block 2-3'),
          ('24', 'Block 2-4'),
      )
      class_list = models.TextField()
      course_name = models.CharField(max_length=20, choices=COURSE_NAME)
      course_block = models.CharField(max_length=10, choices=BLOCK_NUMBER)
      group_size = models.IntegerField(default=3)
  
      def __str__(self):
          return self.get_course_block_display()
  
      def save(self, *args, **kwargs):
          super(Classroom, self).save(*args, **kwargs)
          # overrides the default save function to parse the class list
          studentList = []
          studentList = self.class_list.split('\n')
          print (studentList)
          for line in studentList:
              line = line.strip('\r')
              s = Student.objects.create(nickname = line, classroom = self)
  
  class Student(models.Model):
      classroom = models.ForeignKey(Classroom, on_delete=models.CASCADE)
      student_first = models.CharField(default='John', max_length=30)
      student_last = models.CharField(default='Smith', max_length=30)
      nickname = models.CharField(default='JohnS', max_length=31)
      attend = models.BooleanField(default=True)        
  </code></pre>
  
  <p>I know that I'm not yet filtering the list_random_view for a specific block, I think I know how to do that.  </p>