所以我尝试遵循 django 本身的文档如何创建 CSV 文件,我复制了代码但它没有用,应该是浏览器在成功时下载 somefilename.csv ,有什么问题吗?还是我需要在settings.py中设置一些东西?这是代码(HTML 和视图)
<div class="col-lg-12">
<div class="form-panel">
<form action="#" class="form-horizontal style-form" id="form1">
<div class="form-group">
<label class="control-label col-md-3">Campaign Name</label>
<div class="col-md-3 col-xs-11">
<input id = "campaign_name" type="text" class="form-control form-width">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3">Campaign Type</label>
<div class="col-md-3 col-xs-11">
<div class="btn-group">
<select id = "campaigntype" style="width:425px;background-color:white;height:30px;font-color:red;text-align-last:center;">
<option disabled selected value>-- Choose --</option>
<!-- <li><a href="#"></a></li> -->
<option value = "Informasi" >Informasi</option>
<option value = "Promosi" >Promosi</option>
<!-- <li><a href="#">Dropdown link</a></li> -->
</select>
</div>
</div>
</div> …Run Code Online (Sandbox Code Playgroud)