feat: Added fancy bootstrap UI

This commit is contained in:
2018-04-27 14:45:04 +02:00
parent 9e1126b621
commit 32e9205381
25 changed files with 32027 additions and 2 deletions

14
test.py
View File

@@ -1,9 +1,12 @@
#!/usr/bin/env python3
from flask import Flask, request, send_file
from flask import Flask, request, send_file, send_from_directory, render_template
from flask_wtf.csrf import CSRFProtect
from xlsx_replacement import XlsxReplacement
from pdf_merger import PdfMerger
app = Flask(__name__)
app = Flask(__name__, template_folder='html')
app.config['SECRET_KEY'] = 'TOP SECRET'
csrf = CSRFProtect(app)
@app.route('/pdf-test/pdf_replace', methods=['POST'])
@@ -20,6 +23,13 @@ def test_upload():
return send_file(out, mimetype='application/pdf', attachment_filename=request.files['pdf'].filename)
@app.route("/pdf-test/<path:path>")
def static_files(path: str):
if path.endswith('.html'):
return render_template(path)
return send_from_directory('html', path)
@app.route('/pdf-test/testpage')
def test_page():
return """