Django templates: Simple numeric for loop with only built in components
Monday, April 5th, 2010Scenario: In your web page, you want to print out a few identical items in a loop. Perhaps you want 5 rows worth of initial inputs available in a form. Problem: Django’s template language has no way to do a simple numeric loop. Solution: {% for i in 12345|make_list %} {{ i }} {% endfor [...]
