{% if is_paginated %}
    <nav>
        <ul class="pagination">
        {% if page_obj.has_previous %}
            {% if first_page %}
                <li>
                    {% if search_paging %}<a href="?page={{ first_page }}&search_word={{ search_word }}">{% else %}<a href="?page={{ first_page }}">{% endif %}
                        <span><<</span>
                    </a>
                </li>
            {% endif %}
            <li>
                {% if search_paging %}<a href="?page={{ page_obj.previous_page_number }}&search_word={{ search_word }}">{% else %}<a href="?page={{ page_obj.previous_page_number }}">{% endif %}
                    <span> < </span>
                </a>
            </li>
        {% endif %}

        {% for page in page_range %}
            <li {% if page == page_obj.number %}class="active" {% endif %}>
            {% if search_paging %}<a href="?page={{ page }}&search_word={{ search_word }}">{{ page }}</a>{% else %}<a href="?page={{ page }}">{{ page }}</a>{% endif %}
            </li>
        {% endfor %}

        {% if page_obj.has_next %}
            <li>
                {% if search_paging %}<a href="?page={{ page_obj.next_page_number }}&search_word={{ search_word }}">{% else %}<a href="?page={{ page_obj.next_page_number }}">{% endif %}
                    <span> > </span>
                </a>
            </li>
            {% if last_page %}
                <li>
                    {% if search_paging %}<a href="?page={{ last_page }}&search_word={{ search_word }}">{% else %}<a href="?page={{ last_page }}">{% endif %}
                        <span> >> </span>
                    </a>
                </li>
            {% endif %}
        {% endif %}
        </ul>
    </nav>
{% endif %}