Finished admin console

This commit is contained in:
2022-06-15 23:54:44 +01:00
parent 62160beab2
commit 2ea778143e
33 changed files with 198 additions and 206 deletions

View File

@@ -1,3 +1,4 @@
from app.models import User
from app.modules import bootstrap, csrf, db, login_manager, mail
from config import Config
@@ -21,8 +22,8 @@ def create_app():
login_manager.login_view = 'admin._login'
@login_manager.user_loader
def _load_user(user_id):
pass
def _load_user(id):
return User.query.filter_by(id=id).first()
@app.errorhandler(404)
def _404_handler(error):
@@ -32,7 +33,7 @@ def create_app():
return jsonify({'error':'Could not validate a secure connection.'}), 403
@app.context_processor
def _now():
return {'now': datetime.utcnow()}
return {'now': datetime.now()}
from app.admin.views import admin
from app.api.views import api