Search code examples
pythondjangoapscheduler

Share one global apscheduler scheduler across all modules Django


I need to save apscheduler scheduler instance I'm working with to remove it later or modify.

I have django web app. I have notification model in django admin. After creating a new row - I schedule notification to send it later on my email. And that part works perfectly.

But what if I need to change the notification or delete it?
There is problem..

With some "returns" I've got the schedule instance in my admin.py. But I can only print it to console and that's all. How and where can I save this instance to work with it later? (after delete row 4 example).


Solution

  • Ok just add your scheduler to AppConfig