我正在测试一些选项。我已经使用django-storages和S3上传了一个文件,并且工作正常。但是,当我尝试使用下面的代码读取文件时,出现以下错误:
'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()
慕村225694
相关分类