class Comment(CreateView):
model = Comment
form_class = CommentForm
template_name = 'article_detail.html'
success_url = '/'
def form_valid(self, form):
instance = form.save(commit=False)
instance.comment_article = Article.objects.get(id=1)
instance.save()
return super(Comment, self).form_valid(form)