6

TemplateSyntaxError: unexpected char u'#'Python Google App Engine サーバーによって提供される HTML ファイルに単純な Mustache テンプレートを含めると、エラーが発生します。

含めたい口ひげのテンプレートは次のとおりです。

{{#item}} {{name}} {{/item}}

私のHTMLファイルは次のようになります。

<!DOCTYPE html>
<html>
  <head>
    <script type="text/mustache-template" id="myTemplate">
      {{#item}}{{name}}{{/item}}
    </script>
  </head>
</html>

テンプレートは type=text/mustache-template のスクリプト タグで囲まれているため、サーバーはそれを無視するべきではありませんか?

TemplateSyntaxError が発生する理由と、それを取り除くにはどうすればよいかを理解できません。誰にもアイデアはありますか?ありがとう!

4

1 に答える 1