title: Django: create a comment form when user is authenticated
body: <p>I'm creating a simple blog application. A user is logged in this application while He/She can comment any post on my blog application. But cant impletement that idea. 
  This is my models.py file</p>
  
  <pre><code>from django.db import models
  
  # Create your models here.
  
  from user.models import CustomUser
  
  from django.conf import settings
  from django.db import models
  from django.urls import reverse
  
  class BlogPost(models.Model):
      author = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
      blog_title=models.CharField(max_length=200)
      blog_description=models.TextField()
      blog_pub=models.DateTimeField(auto_now_add=True)
      blog_update=models.DateTimeField(auto_now=True)
  
  
      def __str__(self):
          return self.blog_title
  
  
      def get_absolute_url(self):
  
          return reverse('blog:blog_post', kwargs={'pk': self.pk})
  
  
  
  
  class Comment(models.Model):
      blogpost=models.ForeignKey(BlogPost, on_delete=models.CASCADE)
      comment=models.CharField(max_length=300)
      author=models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,blank=True, null=True)
      author_name = models.CharField(max_length=50, default='anonymous', verbose_name=("user name"))
      comment_pub = models.DateTimeField(auto_now_add=True)
  
      comment_update = models.DateTimeField(auto_now=True)
  
      def get_absolute_url(self):
          return reverse('blog:home', kwargs={'pk':self.pk})
  
      def __str__(self):
          return self.comment
  </code></pre>
  
  <p>This is views.py file</p>
  
  <pre><code>class BlogPostSingle(DetailView, FormView):
      model=BlogPost
      template_name='blog/blog_post_single.html'
      #fields = ['blog_title']
      form_class = CreateCommentForm
      success_url = '/blog/'
  
      def form_valid(self, form):
          form.instance.author = self.request.user
          return super().form_valid(form)
  </code></pre>
  
  <p>this is my forms.py file</p>
  
  <pre><code>class CreateCommentForm(ModelForm):
      class Meta:
          model=Comment
          fields = ('comment', 'blogpost')
  </code></pre>
  
  <p>and this is my html file and forms section</p>
  
  <pre><code>{% if user.is_authenticated %}
          &lt;h5&gt;Hi, {{user.name}} leave your comment now&lt;/h5&gt;
          &lt;form action="" method="post"&gt;
              {% csrf_token %} {{form.as_p}}
  
              &lt;input type="submit" value="Submit comment"&gt;
          &lt;/form&gt;
          {% else %}
          &lt;p&gt;You're not logged in this site, please  &lt;a href="{% url 'login' %}"&gt;log&lt;/a&gt; in for comment &lt;/p&gt;
          {% endif %}
  </code></pre>
  
  <p><strong>My target Idea:</strong> Just user logged on my blog application. He can be able to comment any post on my blog application. And my <strong>Comment</strong> Models   contain two forignkey field.</p>