Q:

Django template add and compare does not work on Heroku

This basic piece of templating code works perfectly fine on localhost.
succes_view.html:
<div id="center">
  Block {{block_number}} succesfully submitted to database. 
  {% if block_number < 5 %}
    <a href='/block/{{block_number|add:"1" }}'> Click here to proceed </a>
 {% else %}
    <p>You completed the task. Thank you and goodbye!
 {% endif %}
</div>

When staging on Heroku the " < " and the "|add:" functionality do not work as expected. It seems the integer is interpreted as a string (eg 2 |add:"1" would return 21 instead of 3).
Any ideas on what's going wrong here and how to solve it?
All help appreciated!
Joris
EDIT: The functionality is now broken on localhost as well. So it's not a Heroku issue anymore. For completeness the relevant parts of view.py and urls.py
views.py:
def succes_view(request, block_number):
    return render(request, 'block/succes_view.html', {'block_number': block_number})

urls.py:
url(r'^succes_view/(?P<block_number>[1-5])/$', views.succes_view, name='succes_view'), 
]

A:

Parameters from the URL are always strings. Since you know it is always going to be a digit between 1 and 5, you can convert it to an int in the view:
return render(request, 'block/succes_view.html', {'block_number': int(block_number)})

