1.views.py 视图中
@csrf_exempt
def Fun(request):
pass
2.在html页面
{% csrf_token %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModaladd">
<a onclick="addexcel()" style="color: white;text-decoration: none;">批量导入</a>
<input type="file" id="btn_file" name="batchimport" onchange="uploadFile()" style="display:none;"/>
</button>