def db_type(cname="default"):
    """Return the type of the *default* database

    Supported values : 'postgres', 'mysql', 'sqlite'

    :param str cname: connection name
    :return: a string or None
    """
    if cname not in settings.DATABASES:
        raise InternalError(
            _("Connection to database %s not configured" % cname))
    for t in ['postgres', 'mysql', 'sqlite']:
        if settings.DATABASES[cname]['ENGINE'].find(t) != -1:
            return t
    return None
dataset/ETHPy150Open tonioo/modoboa/modoboa/lib/db_utils.py/db_type/original