Fix some deprecations and factor out a helper function (#387)

This commit is contained in:
FatherInire 2022-10-28 14:15:48 +11:00 committed by GitHub
parent 4bdfe28a35
commit b46ada9f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 44 deletions

View file

@ -1,4 +1,5 @@
from pathlib import Path
import gevent.monkey
gevent.monkey.patch_all()
from os import environ, path
@ -19,12 +20,17 @@ from sys import stdout, argv
import faulthandler
import json
app = Flask(__name__, template_folder='templates')
app.url_map.strict_slashes = False
app.jinja_env.cache = {}
app.jinja_env.auto_reload = True
faulthandler.enable()
if environ.get("SITE_ID") is None:
from dotenv import load_dotenv
load_dotenv(dotenv_path=Path("env"))
if environ.get("FLASK_PROFILER_ENDPOINT"):
app.config["flask_profiler"] = {
"enabled": True,