111
This commit is contained in:
parent
561c29fd25
commit
0509533ac3
@ -3,6 +3,7 @@ import os
|
|||||||
from flask import Flask, redirect, url_for
|
from flask import Flask, redirect, url_for
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
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
|
||||||
@ -14,6 +15,8 @@ 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