<div class="star-wrapper star-rating">
    {% for x in "12345" %}
    {% with x|add:0 as y %}
    <i class="fa fa-star-solid{% if y <= rating %} active{% endif %}{% if y|add:-1 < rating and y > rating %} half{% endif %}"></i>
    {% endwith %}
    {% endfor %}
</div>