update tornado template contexts