I am not familiar with Bottle, but is seems that you should end your %for
loop.
Maybe something along the lines of %end
edit: I am surprised it would not give you some sort of template error though. That is how Flask and Django work. You labelled your post as Django, but I am pretty sure this is no django.