コード例 #1
0
def home_view(request, template_name='dtr5app/home_anon.html'):
    if request.user.is_authenticated():
        return redirect(reverse('me_results_page'))

    ctx = {'auth_url': api.make_authorization_url(request)}
    return render_to_response(template_name, ctx,
                              context_instance=RequestContext(request))
コード例 #2
0
def home_view(request):
    if request.user.is_authenticated:
        return redirect(reverse("me_results_page"))
    template_name = "dtr5app/home_anon.html"
    context = {"auth_url": api.make_authorization_url(request)}
    return render(request, template_name, context)