def data_dir(default='data'):
    """
    Return persistent data directory or ``default`` if not found
    Warning: Do not use this directory to store sqlite databases in producction
    """
    if 'OPENSHIFT_DATA_DIR' in os.environ:
        return os.environ['OPENSHIFT_DATA_DIR']
    if 'GONDOR_DATA_DIR' in os.environ:
        return os.environ['GONDOR_DATA_DIR']
    if provider.detect() == provider.DOTCLOUD:
        return os.path.expanduser('~/data')
    return default