# This monkey-patching is crucial for eventlet/gevent to work correctly. # It must be done at the very top, before any other modules are imported. import eventlet eventlet.monkey_patch() from dotenv import load_dotenv # Load environment variables BEFORE creating the app load_dotenv() from app import create_app from celery_app import celery app = create_app() app.app_context().push()