[Answered ]-TypeError: Expected a job store instance or a string, got NoneType instead

1👍

After taking a quick glance at the documentation, I think this is the fix:

    def handle(self, *args, **kwargs):
        scheduler = BlockingScheduler(timezone=settings.TIME_ZONE)
        scheduler.add_jobstore(DjangoJobStore(), "d")
        scheduler.add_job(  # I'm guessing you want to add a job
            self.send_email_to_registered_users,  # NOTE: no parenthesis
            trigger=CronTrigger(second="*/10"),
            id="send_email_to_registered_users",
            max_instances=10,
        )
        logger.info("Printing Jobs!!! and sending!!")
        scheduler.start()

PS. isn’t it easier to create a crontab which runs the python manage.py ... command?

Leave a comment