django template, using {% with %} to set a list var

343 Views Asked by At

I need to hard set a list in django template. I know that I have to pass variables to the template, instead of creating them in the template, but I only have access to the template file. I'm using sendinblue with a custom template, and the only way to use custom params injected to the template is to use their api. I only need to hardcode some content in a list, and the content will dynamically appear depending on contact, I think that using an api only for this is overkill.

1

There are 1 best solutions below

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

try this