mirror of
https://github.com/simon987/od-database.git
synced 2025-04-20 10:56:47 +00:00
Download link for export
This commit is contained in:
parent
7ac7972fd6
commit
820caa171b
10
app.py
10
app.py
@ -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):
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
<tbody>
|
||||
{% if export_file_stats %}
|
||||
<tr>
|
||||
<td>out.csv.xz</td>
|
||||
<td><a href="/get_export">out.csv.xz</a></td>
|
||||
<td>{{ export_file_stats.st_size }}</td>
|
||||
<td>{{ export_file_stats.st_mtime|datetime_format }}</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user