removed unneeded ref to font-awesome, added compression, ttl for static files, several small cleanups on labels, etc. for lighthouse improvements

This commit is contained in:
2021-09-14 17:22:42 +10:00
parent 6e96c83d9e
commit 56f3853bfc
7 changed files with 34 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
from flask import Flask, render_template, request, redirect, jsonify, url_for, render_template_string
from flask_compress import Compress
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import SQLAlchemyError
from flask_marshmallow import Marshmallow
@@ -29,6 +30,7 @@ app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['ENV'] = os.environ['FLASK_ENV']
app.config['SECRET_KEY'] = b'my_insecure_PA_token_with_random_2134876adsfjhlkasdf87'
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 31536000
# ldap config vars: (the last one is required, or python ldap freaks out)
app.config['LDAP_HOST'] = 'mara.ddp.net'
@@ -48,6 +50,8 @@ login_manager = LoginManager(app) # Setup a Flask-Login Manager
ldap_manager = LDAP3LoginManager(app) # Setup a LDAP3 Login Manager.
login_manager.login_view = "login" # default login route, failed with url_for, so hard-coded
Compress(app)
################################# Now, import separated class files ###################################
from ai import aistats
from settings import Settings