summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.py b/main.py
index 59c3791..033d8b6 100644
--- a/main.py
+++ b/main.py
@@ -6,6 +6,7 @@ from libmat2 import parser_factory
6 6
7from flask import Flask, flash, request, redirect, url_for, render_template 7from flask import Flask, flash, request, redirect, url_for, render_template
8from flask import send_from_directory, after_this_request 8from flask import send_from_directory, after_this_request
9import jinja2
9 10
10from werkzeug.utils import secure_filename 11from werkzeug.utils import secure_filename
11 12
@@ -14,6 +15,12 @@ app = Flask(__name__)
14app.config['SECRET_KEY'] = os.urandom(32) 15app.config['SECRET_KEY'] = os.urandom(32)
15app.config['UPLOAD_FOLDER'] = './uploads/' 16app.config['UPLOAD_FOLDER'] = './uploads/'
16app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB 17app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB
18app.config['CUSTOM_TEMPLATES_DIR'] = 'custom_templates'
19
20app.jinja_loader = jinja2.ChoiceLoader([ # type: ignore
21 jinja2.FileSystemLoader(app.config['CUSTOM_TEMPLATES_DIR']),
22 app.jinja_loader,
23 ])
17 24
18def __hash_file(filepath: str) -> str: 25def __hash_file(filepath: str) -> str:
19 sha256 = hashlib.sha256() 26 sha256 = hashlib.sha256()