Dimi Dimi - 1 month ago 9
Python Question

What does the vertical bar mean in Flask Templates?

I am working on a flask tutorial, and in the sample code, it contains the following:

| {% for pr in providers %}
<a href ="javascript:set_openid('{{ pr.url}}', '{{ pr.name }}');">{{ pr.name }}</a> |
{% endfor %}


In this context, what do the vertical bars mean?

Answer
| {% for pr in providers %}
    <a href ="javascript:set_openid('{{ pr.url}}', '{{ pr.name }}');">{{ pr.name }}</a> |
{% endfor %}

this bars will be displayed in the html output, it is there to enhance readability. For example, if the providers list contains say 3 links in total they will be displayed one after another separated by | due to for loop.

possible output:

|link1| link2| link3|