diff --git a/README b/README index b037f98..3ef682a 100644 --- a/README +++ b/README @@ -46,10 +46,6 @@ upstream packages... wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.min.js.map wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.ui.position.min.js - # font-awesome - ### browse to https://fontawesome.com/download, grab zip, unzip it into static/upstream - # in fa-stack hand change width:2.5em to width:2em - ### I tried to update via pip3, with this: sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev libgirepository1.0-dev libcups2-dev pip3 list | tail -n +3 | grep -v mysqlclient | grep -v duplicity | grep -v gpg | awk ' { print $1 } ' | xargs pip3 install --upgrade diff --git a/TODO b/TODO index d148c7c..2db8e8f 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,11 @@ ## GENERAL - * face locations -- START FORM SCRATCH for prod so all images have face_locn data + * get build process to create a random string for secret for PROD, otherwise use builtin for dev + + * lighthouse -> leverage this for cache control for static... + https://www.kite.com/python/docs/flask.Flask.get_send_file_max_age + + * comment your code + * html files? * per file you could select an unknown face and add it as a ref img to an existing person, or make a new person and attach? * from menu, we could try to get smart/fancy... say find face with largest size, check it vs. other faces, if it matches more than say 10? we offer it up as a required ref img, then cut that face (with margin) out and use it is a new ref image / person @@ -7,8 +13,6 @@ https://www.pyimagesearch.com/2018/07/09/face-clustering-with-python/ * fix up logging in general - * comment your code - * html files? ## DB * Dir can have date in the DB, so we can do Oldest/Newest dirs in Folder view @@ -29,6 +33,7 @@ Admin -> delete old jobs / auto delete jobs older than ??? -> do I want to have admin roles/users? + -> purge deleted files (and associated DB data) ### AI * faces per file (need a threshold for too many? OR diff --git a/main.py b/main.py index cc6ec24..5d2ce2d 100644 --- a/main.py +++ b/main.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 06b2253..8d18b8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,4 @@ pytz dlib face_recognition Werkzeug +flask-compress diff --git a/templates/base.html b/templates/base.html index 4a226f5..e27519a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,13 +1,12 @@ {% if not InDBox %} - + + Photo Assistant - - - + diff --git a/templates/jobs.html b/templates/jobs.html index f27b248..ec05c0d 100644 --- a/templates/jobs.html +++ b/templates/jobs.html @@ -55,15 +55,16 @@ Active JobsJob StartedProgress - - + + + {% endblock main_content %} diff --git a/templates/login.html b/templates/login.html index 635f695..8eefb3c 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,8 +1,12 @@ - + + + +Photo Assistant Login + @@ -46,12 +50,12 @@  Photo Assistant Login
- - + +
- - + +