feat: Added fancy bootstrap UI
This commit is contained in:
14
test.py
14
test.py
@@ -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 """
|
||||
|
||||
Reference in New Issue
Block a user