1 from datetime import timedelta
2 from django.core.management.base import BaseCommand, CommandError
3 from django.utils.timezone import now
4 from club.models import Schedule
7 class Command(BaseCommand):
8 def handle(self, *args, **options):
9 for s in Schedule.objects.filter(is_cancelled=False, expires_at__lt=now() + timedelta(1)):
10 print(s, s.email, s.expires_at)