方法一:读取上传的
    参考:https://stackoverflow.com/questions/58288497/how-do-i-receive-an-excel-file-as-input-using-flask-and-read-it-using-openpyxl
    html 代码:

    1. <form action="{% url 'article_list_import' %}" method="POST" enctype="multipart/form-data">
    2. {% csrf_token %}
    3. <input type="file" id="article_list" name="article_list">
    4. <input type="submit" value="Submit">
    5. </form>

    View.py 代码

    1. def article_list_import(request):
    2. if request.method == 'POST':
    3. try:
    4. article_list_file = request.FILES.get('article_list')
    5. from openpyxl import load_workbook
    6. wb = load_workbook(filename=article_list_file)
    7. except:
    8. pass

    方法二:上传到临时文件路径
    参考:https://www.jianshu.com/p/61ecb53acbf7