django template的上下文不能自动转化int和string,如:
view中
return render(request, 'book20/index.html', {
'passage_list': passage_list,
'chapter': chapter,
'start_chapter': '0',
'end_chapter': '27',
})
html中, start_chapter成为'0'而不是0:
{% if chapter != start_chapter %}