`from rest_framework.compat import urlparse` should fix your travis Py3k issues.