Polars Read Excel file from Form (ie. request.FILES.get('file'))

All the Polars examples show reading an Excel file from a path string.

df = pl.read_excel("docs/assets/data/path.xlsx")

But I am passing in the Excel file from a Django Form Post.

file_name = request.FILES.get('file')

df = pl.read_excel(file_name)

I am getting a "InvalidParametersError".

How do input the file to Polars from a HTML form?

or do I somehow have to get the path from the request.FILES and use that?

I am new to the whole Polars thing but very excited to try it.

thank you.

Вернуться на верх