[Fixed]-How do you construct a django template variable dynamically

1👍

Instead of passing a bunch of variables named variable_name_i, the best way is to pass a list in as variable_name with each of the elements.

Then, you can use something like this to access each member of the list.

{% for i in variable_name %}
     {{ i }}
{% endfor %}
👤meyer9

Leave a comment