{% for star in "12345" %} {% if rating >= star|add:0 %} ★ {% else %} ☆ {% endif %} {% endfor %}