#!/usr/bin/env python3
"""
Test minimal pour identifier le problème avec Python 3.14
"""

import sys
print(f"Python version: {sys.version}")

# Test 1: Import Django
try:
    import django
    print(f"✅ Django version: {django.VERSION}")
except Exception as e:
    print(f"❌ Erreur Django import: {e}")
    sys.exit(1)

# Test 2: Setup Django
try:
    import os
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'duhaz_blog.settings')
    import django
    django.setup()
    print("✅ Django setup OK")
except Exception as e:
    print(f"❌ Erreur Django setup: {e}")
    import traceback
    traceback.print_exc()
    sys.exit(1)

# Test 3: Import models
try:
    from blog.models import Blog, Cat_Blog
    print("✅ Import Blog models OK")
except Exception as e:
    print(f"❌ Erreur import Blog models: {e}")
    import traceback
    traceback.print_exc()

# Test 4: Créer une instance
try:
    cat = Cat_Blog(cb_titre="Test")
    print(f"✅ Création instance Cat_Blog OK: {cat}")
except Exception as e:
    print(f"❌ Erreur création instance: {e}")
    import traceback
    traceback.print_exc()

# Test 5: Test admin
try:
    from blog.admin import Blog_Admin
    print(f"✅ Import Blog_Admin OK: {Blog_Admin}")
except Exception as e:
    print(f"❌ Erreur import Blog_Admin: {e}")
    import traceback
    traceback.print_exc()

print("\n--- Test terminé ---")
