# myapp/management/commands/my_task.py from django.core.management.base import BaseCommand from weather.utils import send_telegram_stats class Command(BaseCommand): help = 'Send to telegram weather stats' def handle(self, *args, **kwargs): send_telegram_stats() print("Telegram stats sent")