I was looking for almost the same question and found the widthratio template tag.
Instead of having the percentage already calculated like in your question, you can use this tag to calculate the percentage in the template from the original value and total value against which your percentage is calculated. It does the job if you only need an integer percentage without precision:
{% widthratio value total_value 100 %}
Ref: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#widthratio
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…