#!/usr/bin/env python3
"""
WSGI entry point for DonShare API
Configuration for O2switch Setup Python App
"""

import os
import sys
from pathlib import Path

# Ajouter le répertoire du projet au PYTHONPATH
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))

# Configuration des variables d'environnement pour O2switch
os.environ.setdefault('DATABASE_URL', 'postgresql://donshare_user:donshare_password@localhost:5432/donshare_db')
os.environ.setdefault('SECRET_KEY', 'your-secret-key-change-in-production')
os.environ.setdefault('DEBUG', 'False')
os.environ.setdefault('CORS_ORIGINS', 'https://donshare.paydiaa.com,https://www.donshare.paydiaa.com')
os.environ.setdefault('API_V1_PREFIX', '/api/v1')
os.environ.setdefault('PROJECT_NAME', 'DonShare API')
os.environ.setdefault('VERSION', '1.0.0')

# Import de l'application FastAPI
from app.main import app

# Configuration pour WSGI
application = app

# Point d'entrée WSGI pour O2switch
if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)
