{% if tickets.has_previous %}
{% endif %}
{% for num in tickets.paginator.page_range %}
{% if num == tickets.number %}
{{ num }}
{% elif num >= tickets.number|add:'-2' and num <= tickets.number|add:'2' %}
{{ num }}
{% endif %}
{% endfor %}
{% if tickets.has_next %}
{% endif %}