Don't use xrange in the Python template even though it is the right thing to do for Python 2.x. xrange no longer exists in Python 3 and we cannot use 2to3 for templates.