0

我需要在 django 模板中硬设置一个列表。我知道我必须传递变量to the template,而不是创建它们in the template,但我只能访问模板文件。我将 sendinblue 与自定义模板一起使用,使用注入模板的自定义参数的唯一方法是使用他们的 api。我只需要硬编码列表中的一些内容,内容会根据联系人动态显示,我认为仅为此使用api是大材小用。

4

1 回答 1

0
{% with tt='123'|make_list %}
    {{ tt }}
    <hr>
    {% for x in tt %}
        {{ x }}<br>
    {% endfor %}
{% endwith %}

尝试这个

于 2020-12-08T19:20:32.637 回答