不过Tornado的维护者Ben Darnell说:

I think arguments passed in to templates show up in globals() instead of locals(), but this is an implementation detail that should not be relied upon. In general I recommend making sure the variable you need always exists, even if it is None or "" by default. If that's not practical, I suggest making it an attribute of some object that always exists, such as the RequestHandler. This way you can say {{getattr(handler, "var", "")}}.