import os import sqlite3 from flask import Flask from config import Config from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager # Flask app setup app = Flask(__name__, static_folder='static', template_folder='template') app.secret_key = os.environ.get("SECRET_KEY") or os.urandom(24) app.config.from_object(Config) db = SQLAlchemy(app) migrate = Migrate(app, db) # User session management setup # https://flask-login.readthedocs.io/en/latest login_manager = LoginManager(app) from server import routes from database import models