Hi,
i am looking for a way where i can execute a task at a particular date and time, i tried apscheduler for this purpose but i am finding some difficulty while integerating with django. can anyone help me with this
the flow is
user will specify a particular date and time through GUI --> submit --> the task will be executed at the particular date and time the user mentioned
i have tried the following in django (Apscheduler approach)
import time
from datetime import datetime
from apscheduler.scheduler import Scheduler
import os
def func1(self,exec_date):
from_time = datetime.datetime.strptime("2014-05-29 13:56:59",'%Y-%m-%d %H:%M:%S')
self.exec_date = datetime.datetime ( from_time.year,from_time.month,from_time.day,from_time.hour,from_time.minute)
return exec_date
sched = Scheduler()
sched.start()
def my_job(test,exec_date):
print test
os.system("python C://Python27/Lib/idlelib/tim.py")
job = sched.add_date_job(my_job,exec_date, ['hello'])
the issue i am facing is the input that the user gives (date n time) is in forms.py ,i have written the code for apscheduler in views.py and i call the function through urls.py but the code doesn't really seem to work,can anyone suggest me how apscheduler works with django or guide me with some links which give information about that
Thanks in advance
Thanks and regards
Rini