我正在測試一些選項。我已經(jīng)使用django-storages和S3上傳了一個文件,并且工作正常。但是,當(dāng)我嘗試使用下面的代碼讀取文件時,出現(xiàn)以下錯誤:'FieldFile'對象沒有屬性'startswith'為什么?甚至default_storage.exists(self.filepath)也給出相同的錯誤。 csv_file = default_storage.open(self.filepath, 'r') new_object = CSVImport(csvfile=csv_file.read(), model=Contact, modelspy=".", mappings="1=first_name,2=mobile,3=email,4=last_name,5=43,6=16") new_object.run()
FieldFile對象沒有屬性'startswith'
慕標(biāo)琳琳
2021-04-06 01:17:24