def reply(req,post_id): post = Post.objects.get(id=post_id) if req.method == "POST": urf = ReplyForm(req.POST) if urf.is_valid(): urf = urf.save(commit=False) print req.user urf.user = req.user urf.post = post urf.save() return redirect('/blog/%s/' % post.id) else: urf = ReplyForm() return render(req, 'reply.html',{'urf':urf})