Home » excel » Python/Django excel to html

Python/Django excel to html

Posted by: admin May 14, 2020 Leave a comment


Okay, so what I want to do is upload an excel sheet and display it on my website, in html. What are my options here ? I’ve found this xlrd module that allows you to read the data from spreadsheets, but I don’t really need that right now.

How to&Answers:

Why don’t you need xlrd? It sounds like exactly what you need.

Create a Django model with a FileField that holds the spreadsheet. Then your view uses xlrd to loop over the rows and columns and put them into an HTML table. Job done.

Possible complications: multiple sheets in one Excel file; formulas; styles.


Use Zoho Viewer in your template.
For example:

<iframe src="http://viewer.zoho.com/api/urlview.do?url=http://www.iasted.org/conferences/formatting/Presentations-Tips.ppt&embed=true"
        style="width:300px; height:300px;" frameborder="0">