{% macro render_pagination(pagination,
                           endpoint,
                           prev=('&laquo;')|safe,
                           next=('&raquo;')|safe,
                           ellipses='…')
-%}
<nav>
  <ul class="pagination"{{kwargs|xmlattr}}>
  {# prev and next are only show if a symbol has been passed. #}
  {% if prev is not None -%}
    <li {% if not pagination.has_prev %}class="disabled"{% endif %}><a href="{% if pagination.has_prev %}{{url_for(endpoint, page=pagination.prev_num)}}{% else %}#{% endif %}">{{prev}}</li></a>
  {%- endif -%}

  {%- for page in pagination.iter_pages() %}
    {% if page %}
      {% if page != pagination.page %}
        <li><a href="{{url_for(endpoint, page=page)}}">{{page}}</a></li>
      {% else %}
        <li class="active"><a href="#">{{page}} <span class="sr-only">(current)</span></a></li>
      {% endif %}
    {% elif ellipses is not None %}
      <li class="disabled"><a href="#">{{ellipses}}</a></li>
    {% endif %}
  {%- endfor %}

  {% if next is not None -%}
    <li {% if not pagination.has_next %}class="disabled"{% endif %}><a href="{% if pagination.has_next %}{{url_for(endpoint, page=pagination.next_num)}}{% else %}#{% endif %}">{{next}}</li></a>
  {%- endif -%}
  </ul>
</nav>
{% endmacro %}

{% macro render_pagination(pagination,
                           endpoint,
                           prev=('&laquo;')|safe,
                           next=('&raquo;')|safe,
                           ellipses='…')
-%}
<nav>
  <ul class="pagination"{{kwargs|xmlattr}}>
  {# prev and next are only show if a symbol has been passed. #}
  {% if prev != None -%}
    <li {% if not pagination.has_prev %}class="disabled"{% endif %}><a href="{% if pagination.has_prev %}{{url_for(endpoint, page=pagination.prev_num)}}{% else %}#{% endif %}">{{prev}}</li></a>
  {%- endif -%}

  {%- for page in pagination.iter_pages() %}
    {% if page %}
      {% if page != pagination.page %}
        <li><a href="{{url_for(endpoint, page=page)}}">{{page}}</a></li>
      {% else %}
        <li class="active"><a href="#">{{page}} <span class="sr-only">(current)</span></a></li>
      {% endif %}
    {% elif ellipses != None %}
      <li class="disabled"><a href="#">{{ellipses}}</a></li>
    {% endif %}
  {%- endfor %}

  {% if next != None -%}
    <li {% if not pagination.has_next %}class="disabled"{% endif %}><a href="{% if pagination.has_next %}{{url_for(endpoint, page=pagination.next_num)}}{% else %}#{% endif %}">{{next}}</li></a>
  {%- endif -%}
  </ul>
</nav>
{% endmacro %}

Use !=, as is not None is not supported in Jinja2 syntax.
Use !=, as is not None is not supported in Jinja2 syntax.
