diff --git a/tornado/template.py b/tornado/template.py index 14cb967e..5cc5e003 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -532,7 +532,8 @@ def _parse(reader, in_block=None): raise ParseError("Extra {%% end %%} block on line %d" % line) return body - elif operator in ("extends", "include", "set", "import", "comment"): + elif operator in ("extends", "include", "set", "import", "from", + "comment"): if operator == "comment": continue if operator == "extends": @@ -540,7 +541,7 @@ def _parse(reader, in_block=None): if not suffix: raise ParseError("extends missing file path on line %d" % line) block = _ExtendsBlock(suffix) - elif operator == "import": + elif operator in ("import", "from"): if not suffix: raise ParseError("import missing statement on line %d" % line) block = _Statement(contents)