def comment_page(request, blog_id=None): if request.method == 'POST': form = CommentForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(reverse('comment_thanks')) else: form = CommentForm() context={ 'form': form.as_p(), 'blog_entry': BlogArticle.objects.get(id=blog_id) } context.update(csrf(request)) return render_to_response( 'comment_page.html', context=context )