如何在django模板中连接字符串?

我想在Django模板标记中连接一个字符串,如:

{%extend-shop/shop\u-name/base.html%}

这里的shop\u name是我的变量,我想将其与路径的其余部分连接起来

假设我有shop\u name=example.com,我希望结果扩展shop/example.com/base.html

用于:

{%加上“shop/”|添加:shop_name |添加:“/base.html”作为模板%}
{%include template%}
{%endwith%}

发表评论