The canonical answer to this is to use Celery, which provides a task queue for any background/scheduled tasks you want to use.
It's pretty easy to get set up, and works well. Malcolm On Tuesday, 10 June 2014 06:37:46 UTC+1, Rini Michael wrote: > > 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 > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/782c7d3c-735f-4eaa-9f6d-6f7692268003%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.