      then perform the necessary import or imports.
      """
      if val is None:
          return None
      elif isinstance(val, six.string_types):
          return import_from_string(val, setting_name)
      elif isinstance(val, (list, tuple)):
          return [import_from_string(item, setting_name) for item in val]
      return val
  
 
</s> remove         name = six.text_type(value.obj)
 </s> add         name = str(value.obj) </s> remove     elif isinstance(value, six.string_types):
 </s> add     elif isinstance(value, str): </s> remove         return super(JSONEncoder, self).default(obj)
 </s> add         return super().default(obj) </s> remove             return six.text_type(obj)
 </s> add             return str(obj) </s> remove     return six.text_type(value)
 </s> add     return str(value)
    elif isinstance(val, str):
      then perform the necessary import or imports.
      """
      if val is None:
          return None
    elif isinstance(val, str):
          return import_from_string(val, setting_name)
      elif isinstance(val, (list, tuple)):
          return [import_from_string(item, setting_name) for item in val]
      return val
  
keep keep keep keep 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/settings.py