I\'ve been working on a web app using Django, and I\'m curious if there is a way to schedule a job to run periodically.
Basically I just want to run through the dat
Django APScheduler for Scheduler Jobs. Advanced Python Scheduler (APScheduler) is a Python library that lets you schedule your Python code to be executed later, either just once or periodically. You can add new jobs or remove old ones on the fly as you please.
note: I'm the author of this library
pip install apscheduler
file name: scheduler_jobs.py
def FirstCronTest():
print("")
print("I am executed..!")
make execute.py file and add the below codes
from apscheduler.schedulers.background import BackgroundScheduler
scheduler = BackgroundScheduler()
Your written functions Here, the scheduler functions are written in scheduler_jobs
import scheduler_jobs
scheduler.add_job(scheduler_jobs.FirstCronTest, 'interval', seconds=10)
scheduler.start()
Now, add the below line in the bottom of Url file
import execute