gpt4 book ai didi

python - Django 模板中的 {% include '' with %}

转载 作者:行者123 更新时间:2023-12-01 09:27:17 24 4
gpt4 key购买 nike

我正在尝试以特定方式使用下面的代码。

{% include 'your_template_here' with keyword='your_value_here' %}

我想要做的是将我的参数 store_list 传递到 your_value_here 作为参数 keyword 的参数。也就是说,它应该类似于以下内容:

{% include 'your_template_here' with keyword={{ store_list }} %}

但是,它有一个语法错误。是否不允许在 {% include ' ' with=' ' %} 中传递查询集?

最佳答案

您需要删除关键字中的双大括号。

{% include 'your_template_here' with keyword=store_list %}

关于python - Django 模板中的 {% include '' with %},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50280265/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com