Download link for export

This commit is contained in:
Simon
2018-06-06 11:27:23 -04:00
parent 7ac7972fd6
commit 820caa171b
2 changed files with 10 additions and 2 deletions

10
app.py
View File

@@ -1,4 +1,4 @@
from flask import Flask, render_template, redirect, request, flash, abort, Response
from flask import Flask, render_template, redirect, request, flash, abort, Response, send_from_directory
import os
import json
import time
@@ -41,6 +41,14 @@ def downloads():
return render_template("downloads.html", export_file_stats=export_file_stats)
@app.route("/get_export")
def get_export():
if os.path.exists("static/out.csv.xz"):
return send_from_directory("static", "out.csv.xz", as_attachment=True, mimetype="application/x-xz")
return abort(404)
@app.route("/website/<int:website_id>/")
def website_info(website_id):