code: def to_localtime(time):
      '''Converts naive datetime to localtime based on settings'''
  
      utc_time = time.replace(tzinfo=timezone.utc)
      to_zone = timezone.get_default_timezone()
      return utc_time.astimezone(to_zonef to_localtime(time):
      '''Converts naive datetime to localtime based on settings'''
  
      utc_time = time.replace(tzinfo=timezone.utc)
      to_zone = timezone.get_default_timezone()
      return utc_time.astimezone(to_zone)
docs: Converts naive datetime to localtime based on settings