Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ビューにレンダリングする前に、強力なタグの内側にラップし、コンマで区切ろうとしているアイテムのリストがあります。
これが行です:
{% set exts = ', '.join("<strong>%s</strong>" ~ ext for ext in allowed_file_exts) %}
しかし残念ながら、次のエラーが表示されます。
TemplateSyntaxError: expected token ',', got 'for'
助言がありますか?
正確な問題はわかりませんが、リストの理解に問題があるようです。
代わりに次の行を試してください。
{% set exts = ', '.join(["<strong>%s</strong>" % ext for ext in allowed_file_exts]) %}