I am downloading a pandas data-frame as a csv file using this approach:
view.py ....
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="' + filename + '"'
my_df.to_csv(response, encoding='utf-8', index=False, )
return response
in my html, I have ...
<form class="default_form" method="POST" action="do_export">
{% csrf_token %}
<br/>
<input type="submit" class="btn btn-primary exportOut" value="Do Export"
id="myExport"/>
<br/>
</form>
The file export works fine. However, after the export is done, I need to be able to show a message on the html page .... something like {{ my_message}} without reloading the page.
if this is feasible, I would appreciate any suggestion on how to do this, without resorting to AJAX, which I abandoned because some of the downloads can be large.