@cache_control(must_revalidate=True, max_age=3600, private=True)
def page_detail(request, slug, template_name='wiki/page_detail.html'):
    try:
        page = Page.objects.filter(slug=slug).get()
    except __HOLE__:
        page = Page(title=title(slug), slug=slug)

    if not page.has_read_permission(request.user):
        if request.user.is_anonymous():
            return HttpResponseRedirect('%s?%s=%s' % (settings.LOGIN_URL, REDIRECT_FIELD_NAME, urlquote(request.get_full_path())))
        else:
            return render_to_response('wiki/permission_denied.html', context_instance=RequestContext(request))

    return render_to_response(template_name,
        {'page':page, 'page_exists': bool(page.pk)}, RequestContext(request))
dataset/ETHPy150Open kylef-archive/lithium/lithium/wiki/views.py/page_detail