              u_params = ()
          else:
              u_params = {to_unicode(k): to_unicode(v) for k, v in params.items()}
  
          return six.text_type("QUERY = %r - PARAMS = %r") % (sql, u_params)
  
      def last_insert_id(self, cursor, table_name, pk_name):
          """
          Given a cursor object that has just performed an INSERT statement into
          a table that has an auto-incrementing ID, returns the newly created ID.
 
</s> remove             u_params = {to_unicode(k): to_unicode(v) for k, v in params.items()}
 </s> add             u_params = {to_string(k): to_string(v) for k, v in params.items()} </s> remove             u_params = tuple(to_unicode(val) for val in params)
 </s> add             u_params = tuple(to_string(val) for val in params) </s> remove                             if hasattr(field_value, '__iter__') and not isinstance(field_value, six.text_type):
 </s> add                             if hasattr(field_value, '__iter__') and not isinstance(field_value, str): </s> remove         stream_class = StringIO if isinstance(content, six.text_type) else BytesIO
 </s> add         stream_class = StringIO if isinstance(content, str) else BytesIO </s> remove         if isinstance(index, six.string_types):
 </s> add         if isinstance(index, str):
        return "QUERY = %r - PARAMS = %r" % (sql, u_params)
              u_params = ()
          else:
              u_params = {to_unicode(k): to_unicode(v) for k, v in params.items()}
  
        return "QUERY = %r - PARAMS = %r" % (sql, u_params)
  
      def last_insert_id(self, cursor, table_name, pk_name):
          """
          Given a cursor object that has just performed an INSERT statement into
          a table that has an auto-incrementing ID, returns the newly created ID.
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/db/backends/base/operations.py