AI-News-Agent / app.py
OxbridgeEconomics
Initial commit
ab30e46
raw
history blame
No virus
622 Bytes
"""Module that initializes the Flask application."""
import logging
import os
from dotenv import load_dotenv
from flask import Flask
from routes import main
load_dotenv(".env")
def create_app():
"""
Creates and configures the Flask application.
Returns:
Flask: The configured Flask application.
"""
flask_app = Flask(__name__)
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(funcName)s - %(message)s')
logging.getLogger().setLevel(os.environ.get("LOG_LEVEL", "INFO").upper())
flask_app.register_blueprint(main.bp)
return flask_app
app = create_app()