0

I have a django project and i need the ability for executing a function at a specified time on django server. for example you can consider that in my django project if a client request for friendship to another person if after (say) 7 days that person doesn't answer that request the request will be automatically removed. so i want the ability of calling a function on django server at a specified time that is stored in mysql table.

Prashant Kumar
  • 20,069
  • 14
  • 47
  • 63
KinGover
  • 11
  • 1
  • 4
  • Add dates to the corresponding database records, you may create a python script then which loads the django environment and looks for the records and deletes them. The script can be fired via cronjob. – Jingo Nov 18 '13 at 15:38

1 Answers1

3

Create a custom command and create a cron job to run it, also you can check some django apps for manage cron jobs/repetitive tasks. I know you can use it on linux (in windows should be alternatives, I my head sounds now schedule task, but must there be other)

juliocesar
  • 5,706
  • 8
  • 44
  • 63
  • Also check following related questions: http://stackoverflow.com/q/3287038/2343488 http://stackoverflow.com/q/4519829/2343488 http://stackoverflow.com/q/4519829/2343488 maybe it helps you – juliocesar Nov 18 '13 at 16:03
  • Unacepted after acepted why? ...did you finnaly not solve it? – juliocesar Nov 19 '13 at 20:05