use new style exception catch
use xrange from six
use six.text_type instead of unicode
use python_2_unicode_compatible backported from django 1.5