> > >expected string, unicode found > > I got this error when I tried to concatenate strings with the + operator. I suppose some of the strings were unicode, some were not. I solved the problem by splitting my python expression into subsequent <span> tags.