import os
import sys

# === FORCER UTF-8 AVANT TOUT ===
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['LANG'] = 'fr_FR.UTF-8'
os.environ['LC_ALL'] = 'fr_FR.UTF-8'

# Configurer l'encodage
if hasattr(sys, 'setdefaultencoding'):
    reload(sys)
    sys.setdefaultencoding('utf-8')

# Ajouter le chemin de votre projet
PROJECT_PATH = '/home/remacons/public_html/saas'
sys.path.insert(0, PROJECT_PATH)

# Définir les settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'controle.settings'
#sys.path.insert(0, os.path.dirname(__file__))


#def application(environ, start_response):
#    start_response('200 OK', [('Content-Type', 'text/plain')])
#    message = 'It works!\n'
#    version = 'Python %s\n' % sys.version.split()[0]
#    response = '\n'.join([message, version])
#    return [response.encode()]

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

#from controle.wsgi import application