How can I use a variable as index in django template?
Right now I get this error:
Exception Type:
TemplateSyntaxError
Exception Value:
Could not parse the remainder: '[year]' from 'bikesProfit.[year]'
I also tried {{ bikesProfit.year }}
but this gives an empty result.
{% for year in years_list %}
<tr>
<th>Total profit {{ year }}:</th>
</tr>
<tr>
<th></th>
<th> {{ bikesProfit[year] }} </th>
...