<!DOCTYPE html>
<html>
<body>
{% for x in arr %}
<h1>You have {{ x }} butterfl{{ x|pluralize:'y,ies' }} left.</h1>
{% endfor %}
<p>In views.py you can see what the arr variable looks like.</p>
</body>
</html>
from django.http import HttpResponse
from django.template import loader
def testing(request):
template = loader.get_template('template.html')
context = {
'arr': [0, 1, 2]
}
return HttpResponse(template.render(context, request))