These are chat archives for django/django
@transaction.atomic def save_sale_records(file: object): import pdb; pdb.set_trace() with open(file) as csvfile: reader = csv.DictReader(csvfile) for row in reader: print(row)
It gives me error
-> with open(file) as csvfile: (Pdb) n TypeError: expected str, bytes or os.PathLike object, not TemporaryUploadedFile
Form submit file and I can save to to
storage perfectly fine. Therefore I would like to add one more function to read the content of file before response to client.
How can I open my uploaded