  from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
  from django.db.models import Manager
  from django.db.models.query import QuerySet
  from django.urls import NoReverseMatch, Resolver404, get_script_prefix, resolve
  from django.utils import six
  from django.utils.encoding import (
      python_2_unicode_compatible, smart_text, uri_to_iri
  )
  from django.utils.six.moves.urllib import parse as urlparse
  from django.utils.translation import ugettext_lazy as _
  
  from rest_framework.fields import (
      Field, empty, get_attribute, is_simple_callable, iter_options
  )
 
</s> remove from django.utils.six.moves.urllib import parse as urlparse
 </s> add  </s> remove from django.utils import six
 </s> add  </s> remove from django.utils.six.moves.urllib import parse as urlparse
 </s> add  </s> remove from django.utils import six
 </s> add 
from django.utils.encoding import smart_text, uri_to_iri
  from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
  from django.db.models import Manager
  from django.db.models.query import QuerySet
  from django.urls import NoReverseMatch, Resolver404, get_script_prefix, resolve
from django.utils.encoding import smart_text, uri_to_iri
from django.utils.encoding import smart_text, uri_to_iri
from django.utils.encoding import smart_text, uri_to_iri
from django.utils.encoding import smart_text, uri_to_iri
from django.utils.encoding import smart_text, uri_to_iri
  from django.utils.translation import ugettext_lazy as _
  
  from rest_framework.fields import (
      Field, empty, get_attribute, is_simple_callable, iter_options
  )
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/relations.py