title: Form doesn't appear and work in Django project
body: <p>I'm relatively new to Django, so I faced one small problem. I read the documentation and decided to make my own comment form that displays at the same page (DetailView), where I display a question detail and all answers related to this question. I tried to make it as documentation says, but it didn't work. I wrote some functions, but they didn't help as well. Then I copied some styles from bootstrap, something appeared, but I still can't post anything. Seems like POST method doesn't work.</p>
  <p>It was working, when I add the button that leads to the specific page, where users cand leave comments, but I want to show form, display it at the same page, where all answers are displayed. I will appreciate any help, reccomendations and explanations how it works.</p>
  <p>models.py</p>
  <pre><code>class Question(models.Model):
      user = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True)
      title = models.CharField(max_length=250)
      slug = models.SlugField(max_length=255, db_index=True, verbose_name=&quot;URL&quot;)
      detail = models.TextField()
      date_posted = models.DateTimeField(default=timezone.now)
      likes = models.ManyToManyField(User, related_name=&quot;forum_question&quot;)
  
      def total_likes(self):
          return self.likes.count()
  
      def __str__(self):
          return self.title
  
      def get_absolute_url(self):
          return reverse('detail', kwargs={'slug': self.slug})
  
  
  class Answer(models.Model):
       question = models.ForeignKey(Question, on_delete=models.CASCADE)
       user = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True)
       detail = models.TextField()
       date_posted = models.DateTimeField(default=timezone.now)
      likes = models.ManyToManyField(User, related_name=&quot;forum_answer&quot;)
  
      def total_likes(self):
           return self.likes.count()
  
      def __str__(self):
           return self.detail
  
  
  class Comment(models.Model):
      answer = models.ForeignKey(Answer, on_delete=models.CASCADE, null=True)
      user = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True)
      detail = models.TextField()
      date_posted = models.DateTimeField(default=timezone.now)
  
      def __str__(self):
           return '%s - %s' % (self.answer.detail, self.date_posted)
  </code></pre>
  <p>forms.py</p>
  <pre><code>class AnswerForm(forms.ModelForm):
      class Meta:
          model = Answer
          fields = ('detail',)
  
  
  class CommentForm(forms.ModelForm):
      class Meta:
          model = Comment
          fields = ('detail',)
  </code></pre>
  <p>views.py</p>
  <pre><code> class CommentView(LoginRequiredMixin, CreateView):
      model = Comment
      # form_class = CommentForm
      template_name = 'forum/detail.html'
      fields = ['detail']
      success_url = 'forum/detail.html'
      http_method_names = ['post']
  
      def form_valid(self, form):
          form.instance.answer_id = self.kwargs['id']
          form.instance.user = self.request.user
          return super().form_valid(form)
  </code></pre>
  <p>detail.html</p>
  <pre><code>&lt;!-- Comment Section Starts--&gt;
                  &lt;form class=&quot;mb-4 ml-5 mt-3&quot; method=&quot;post&quot; action=&quot;&quot;&gt;
                      {% csrf_token %}
                      {{ form.as_p }}
                      &lt;textarea class=&quot;form-control&quot; rows=&quot;3&quot; placeholder=&quot;Join the discussion and leave a comment!&quot;&gt;&lt;/textarea&gt;
                      &lt;button type=&quot;submit&quot; class=&quot;comment_button btn btn-dark&quot;&gt;Answer&lt;/button&gt;
                  &lt;/form&gt;
  </code></pre>