code: def import_localities(path, delimiter=';'):
      
  
      creates = []
      updates = []
  
      with open(path, mode="r") as infile:
          reader = csv.DictReader(infile, delimiter=str(delimiter))
  
          with atomic():
              for row in reader:
                  row['point'] = Point(float(row['longitude']),
                                       float(row['latitude']))
                  locality, created = Locality.objects.update_or_create(
                      id=row['id'],
                      defaults=row
                  )
                  if created:
                      creates.append(locality)
                  else:
                      updates.append(locality)
  
      return creates, updates
docs: Import localities from a CSV file.
  
      :param path: Path to the CSV file containing the localities.