from django.core.management import call_command

import logging
logger = logging.getLogger("fpl_data")
def update_fpl_data():
    """
    Fetches and updates FPL data using the management command.
    """
    try:
        call_command('update_fpl_data')
    except Exception as e:
        logger.error(f'Error during FPL data update: {e}')  # Log the error