Replaced urllib/urlparse imports with from django.utils.six.moves.