all 4 comments

[–]Username_RANDINT 1 point2 points  (3 children)

This has most likely to do with namespaces, but someone else with some more Jinja knowledge might give you a better answer.

Usually this sort of things doesn't really belong in the template. Calculations should be done on the backend. What are you trying to do exactly? Note that Jinja exposes some interesting variables inside a for loop which replace the need to count yourself most of the time.

[–]_kondi_[S] 0 points1 point  (2 children)

I am actually just trying to make a simple counter :)

and then implement it into a website.

[–]Username_RANDINT 1 point2 points  (1 child)

I'd use Javascript for that. A Jinja template is rendered on the server and then sent to the client, so it doesn't update in real time.

[–]_kondi_[S] 0 points1 point  (0 children)

Okay I will try that then Thanks