From 5a3eb16a7ffbb0cb087376a4d4eff272c7a4b34a Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Tue, 18 Nov 2025 15:54:21 -0500 Subject: [PATCH] Got the app to auto-reload when running in development --- app.py | 7 +++++-- app/__init__.py | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index a409859..488dae9 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,6 @@ -import .app +from app import create_app -app.create_app() +app = create_app() + +if __name__ == "__main__": + app.run(debug=True) diff --git a/app/__init__.py b/app/__init__.py index 90d1155..96b9fc8 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,8 +1,14 @@ from flask import Flask from .controllers.top import top_bp +import os def create_app(): - app = Flask(__name__) + app = Flask( + 'Muspah', + template_folder=os.path.join(os.path.dirname(__file__), 'templates'), + static_folder=os.path.join(os.path.dirname(__file__), 'static'), + instance_relative_config=True + ) app.register_blueprint(top_bp)