There is a view with post display and commentary under it. How to add saving comments after adding and clicking on the button?
def valpost(request, slug = None): instance = get_object_or_404(Post, slug = slug) comment = Comment.objects.all() form = CommentForm(request.POST or None) context = { "title": instance.title, "instance" : instance, "comment_form": form, "comments" : comment, } template = 'post_detail.html' return render(request, template, context)
form.save- YozhEzhifrom myapp.forms import CommentForm- YozhEzhi