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)
views.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录