import sys
import os
sys.path.insert(0, '/home/eventai/event-photo-delivery')

os.environ['FLASK_ENV'] = 'production'

from app import create_app
app = create_app()

with app.app_context():
    import requests
    import json

    # Hit the trigger API directly (internal call)
    try:
        response = requests.post(
            'http://127.0.0.1:8000/admin/api/trigger/run',
            headers={'Cookie': 'session=<your-session-cookie>'},
            timeout=10
        )
        print(f"Trigger response: {response.status_code} - {response.text}")
    except Exception as e:
        print(f"Trigger failed: {e}")