Here is one way to download a CSV file with no Javascript:
#!/usr/bin/python
from flask import Flask, Response
app = Flask(__name__)
@app.route("/")
def hello():
return '''
Hello. Click me.
'''
@app.route("/getPlotCSV")
def getPlotCSV():
# with open("outputs/Adjacency.csv") as fp:
# csv = fp.read()
csv = '1,2,3\n4,5,6\n'
return Response(
csv,
mimetype="text/csv",
headers={"Content-disposition":
"attachment; filename=myplot.csv"})
app.run(debug=True)