I would suggest looking into the built in django pagination utils.  They are quite good.