感觉大部分没有使用到Django其实并不是标题所说的使用Django了。大部分还要是python原生内容为主
首先需要安装xlrd这个扩展包
pip3 install xlrd
然后在Django中接收到文件
import xlrd
fs = reuqest.FILES.get('file_name');
fd = xlrd.open_workbook(filename=None, file_contents=fs.read())
table = fd.sheets()[0]
rows = table.nrows
for i in range(1, rows):
...