Web front enabled basic flask setup

This commit is contained in:
Dylan Wright 2025-06-03 19:45:31 +10:00
parent 013cc90404
commit 962d611b09
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,20 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
db = SQLAlchemy()
login_manager = LoginManager()
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = 'devkey' # Change this for production
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///do_tracker.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
login_manager.init_app(app)
from .routes import main as main_blueprint
app.register_blueprint(main_blueprint)
return app

View File

@ -0,0 +1,7 @@
from flask import Blueprint
main = Blueprint('main', __name__)
@main.route("/")
def home():
return "<h1>DO Tracker Online</h1><p>Welcome to the system.</p>"

6
run.py
View File

@ -0,0 +1,6 @@
from app import create_app
app = create_app()
if __name__ == "__main__":
app.run(debug=True)