from django.core.management.base import BaseCommand from apps.notification.tasks import send_course_access_expire_email class Command(BaseCommand): help = 'Send course access expire email' def add_arguments(self, parser): parser.add_argument( '--days', dest='days', type=int, help='Days before access expired', ) def handle(self, *args, **options): send_course_access_expire_email(options.get('days'))