"""
Package racine du projet Django.

Ce module marque le dossier FacControl comme package Python et centralise les
ajustements d'initialisation necessaires au demarrage global du projet.
"""

try:
    import MySQLdb  # noqa: F401
except ImportError:
    import pymysql

    # Django 6 requires mysqlclient 2.2.1+ on the MySQL backend. PyMySQL
    # exposes a legacy compatibility version, so we bump the advertised
    # version before installing it as MySQLdb.
    if getattr(pymysql, "version_info", (0, 0, 0)) < (2, 2, 1):
        pymysql.version_info = (2, 2, 1, "final", 0)
        pymysql.__version__ = "2.2.1"

    pymysql.install_as_MySQLdb()
