views.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cs122-project-badusumilli-dancassara-lynchc 作者: badusumilli 项目源码 文件源码
def home(request):
    """
    Generates the homepage for the app, using homepage.html

    """
    context = {}
    res = None
    if request.method == 'GET':
        form = HomePage(request.GET)

        if form.is_valid():
            if form.cleaned_data['start_quiz']:
                return HttpResponseRedirect('quiz_form')
        print (context)
    #create dictionary for text displayed on homepage 
    context['explanation_text'] = 'Our 11 question quiz will determine \
    your investor profile, and then recommend an investment portfolio that \
        matches your needs'
    context['error_message'] = 'Each field is Required!'
    context['form'] = form
    return render(request, 'homepage.html', context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号