install apscheduler
install django_apscheduler
settings.py
INSTALLED_APP = [ ... 'django_apscheduler', ... ]
from apscheduler.schedulers.background import BackgroundScheduler def start(): scheduler = BackgroundScheduler() myView = myView scheduler.add_job(myView.somefunction, "interval", seconds=3, id="test_001", replace_existing=True) scheduler.start()
class myConfig(AppConfig): name = 'myApps' def ready(self): print("start Scheduler....") from .scheduler import scheduler scheduler.start()