title: How can I make my comments form work in django?
body: <p>I'm trying to call my comment form from the blog page, but it just keeps refreshing the particular blog page. Here's my code;</p>
  
  <p>models.py</p>
  
  <pre><code>class BlogPost(models.Model):
      # id = models.IntegerField()
      user = models.ForeignKey(User, default=1, null=True, on_delete=models.SET_NULL)
      image = models.ImageField(upload_to='image/', blank=True, null=True)
      title = models.CharField(max_length=120)
      slug = models.SlugField(unique=True)
      content = models.TextField(null=True, blank=True)
      publish_date = models.DateTimeField(auto_now=False, auto_now_add=False, null=True, blank=True)
      timestamp = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
  
      objects = BlogPostManager()
  
      class Meta:
          ordering = ['-publish_date', '-updated', '-timestamp']
  
      def __str__(self):
          return self.title
  
      def get_absolute_url(self):
          return f"/blog/{self.slug}"
  
      def get_edit_url(self):
          return f"{self.get_absolute_url()}/edit"
  
      def get_delete_url(self):
          return f"{self.get_absolute_url()}/delete"
  
  
  class Comment(models.Model):
      comment_cont = models.TextField(max_length=200, verbose_name='Comment content')
      user_name = models.ForeignKey(User, default=1, null=True, on_delete=models.SET_NULL)
      comment_post = models.ForeignKey(BlogPost, on_delete=models.CASCADE, related_name='comments')
      comment_date = models.DateTimeField(default=timezone.now)
  
      def __str__(self):
          return self.comment_cont
  
      def get_absolute_url(self):
          return f"{BlogPost.get_absolute_url()}"
  
      def get_add_url(self):
          return f"{self.get_absolute_url()}/addc"
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def add_comment_to_post(request, slug):
      post = get_object_or_404(BlogPost, slug=slug)
      if request.method == "POST":
          form = CommentForm(request.POST)
          if form.is_valid():
              comment = form.save(commit=False)
              comment.post = post
              comment.save()
              return redirect('blog_post_detail_view', slug=post.slug)
      else:
          form = CommentForm()
      template_name = 'formc.html'
      context = {"title": f"New comment on {post.title}", "form": form}
      return render(request, template_name, context)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>path('&lt;str:slug&gt;/addc', add_comment_to_post),
  </code></pre>
  
  <p>formc.html</p>
  
  <pre><code>&lt;form method='POST' action='.' enctype="multipart/form-data"&gt;
      {% csrf_token %}
      {{ form.as_p }}
      &lt;button type="submit"&gt;Comment&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>button in home.html</p>
  
  <pre><code>&lt;a class="btn btn-primary" href="{{ comments.get_add_url }}"&gt;Add Comment...&lt;/a&gt;
  </code></pre>
  
  <p>I know the <code>href</code> for the button isn't right, but I can't figure out how to make it call the comment form. Please, I need help. Thanks.</p>