-1
我得到了一个错误,在/帐号/ tcresults 提供异常消息的AssertionError 。 我tc.htmlAsse田在/帐号/ tcresults
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Score</title>
</head>
<body>
<h1>Score</h1>
<h2>Your Score is
{{ tcresults.tc }}
{{ value1 = tcresults.tc
if value1 > 5000:
<h2>Good</h2>
elseif value1 < 900:
<h2>Bad</h2>
}}
</h2>
</body>
</html>
中写道views.py
def tc(request):
tcresults = ImageAndUser.objects.filter(user=request.user).order_by('id').last()
d = {
'tcresults': tcresults,
}
return render(request, 'registration/accounts/tc.html', d)
我不明白为什么这个错误发生。 我该怎么做才能解决这个问题?
THX,乌尔comments.I写我们的代码,但数量“你的分数”成为blank.What我应该怎么办? – user7523656
好,坏也没有显示在那里。 – user7523656
THX !!你的分数的一部分〜显示,但如果语句(它包括好的和坏)不shown.What我应该怎样解决这个问题? – user7523656