1
You seem to be using the django-pagination app. It has a setting for the number of items left and right of the current page
PAGINATION_DEFAULT_WINDOW
The number of items to the left and to the right of the current page to display (accounting for ellipses).
So setting
PAGINATION_DEFAULT_WINDOW = 2
would set the middle part as required.
Source:stackexchange.com