`xrange` is Python2 only. I believe our documentation has started to transition to Python3 by default so this should be changed. You could also use `django.utils.six` which provides a compatibility layer.