111
This commit is contained in:
parent
0509533ac3
commit
e1f86a2acb
@ -5,6 +5,9 @@ from flask_migrate import Migrate
|
|||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
# Load .env early so config values (DB URL, secrets, etc.) are available during imports.
|
||||||
|
load_dotenv(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".env")))
|
||||||
|
|
||||||
from app.config import DevelopmentConfig, ProductionConfig
|
from app.config import DevelopmentConfig, ProductionConfig
|
||||||
from app.extensions import db, login_manager, scheduler
|
from app.extensions import db, login_manager, scheduler
|
||||||
from app.services.scheduler import SchedulerService
|
from app.services.scheduler import SchedulerService
|
||||||
@ -15,8 +18,6 @@ def create_app() -> Flask:
|
|||||||
Application factory creating the Flask app, loading config, registering blueprints,
|
Application factory creating the Flask app, loading config, registering blueprints,
|
||||||
initializing extensions, and booting the scheduler.
|
initializing extensions, and booting the scheduler.
|
||||||
"""
|
"""
|
||||||
# Ensure environment variables from .env are loaded when starting via gunicorn/etc.
|
|
||||||
load_dotenv(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".env")))
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
config_name = os.getenv("FLASK_ENV", "development").lower()
|
config_name = os.getenv("FLASK_ENV", "development").lower()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user