Spaces:
Running
Running
# app/__init__.py | |
from flask import Flask | |
import logging | |
import os | |
def create_app(): | |
"""Create and configure the Flask application""" | |
# Set up logging | |
logging.basicConfig( | |
level=logging.INFO, | |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
) | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'dev-secret-key') | |
app.config['DEBUG'] = False | |
# Register routes | |
with app.app_context(): | |
from app.routes import main | |
app.register_blueprint(main) | |
return app |