def blog_post_detail(request, **kwargs):
    
    if "post_pk" in kwargs:
        if request.user.is_authenticated() and request.user.is_staff:
            queryset = Post.objects.all()
            post = get_object_or_404(queryset, pk=kwargs["post_pk"])
        else:
            raise Http404()
    else:
        queryset = Post.objects.current()
        queryset = queryset.filter(
            published__year = int(kwargs["year"]),
            published__month = int(kwargs["month"]),
            published__day = int(kwargs["day"]),
        )
        post = get_object_or_404(queryset, slug=kwargs["slug"])
        post.inc_views()
    
    comment_form = RichCommentForm(auto_id='blog_comment_%s')
    
    return render_to_response("biblion/blog_post.html", {
        "post": post,
        "comment_form": comment_form,
    }, context_instance=RequestContext(request))
dataset/ETHPy150Open caseywstark/colab/colab/apps/biblion/views.py/blog_post_detail/original