Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_comment(request, post_id):
- post_ = Post.objects.get(pk=post_id)
- if request.method == 'POST':
- form = CommentForm(request.POST)
- if form.is_valid():
- post_.comment_set.add(form)
- else:
- form = CommentForm()
- return render(request, 'blog/add_comment.html', {"form": form})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement