Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-14 Thread ringemup
Thank you, Brian and Shawn, for the further explanations! On Oct 13, 11:45 pm, Brian Bouterse wrote: > RabbitMQ implements a standards based protocol called > AMQP, > which provides asynchronous, reliable

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Brian Bouterse
RabbitMQ implements a standards based protocol called AMQP, which provides asynchronous, reliable delivery of messages. The broker simply passes messages around. Celeryd processes join a message broker (RabbitMQ) and pull messages

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 5:25 PM, Javier Guerra Giraldez wrote: > On Wed, Oct 13, 2010 at 3:43 PM, Shawn Milochik wrote: >> C. The Celery daemon polls the broker regularly, looking for tasks. > > i hope this isn't polling, but a signal initiated by the broker. > > -- > Javier

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 5:07 PM, ringemup wrote: > Thank you for taking the time to explain that, Shawn -- it makes > everything a LOT clearer. > > If you could spare the time, I'm curious about a couple of aspects of > the architecture: > > - What is the purpose of having a separate broker and

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Javier Guerra Giraldez
On Wed, Oct 13, 2010 at 3:43 PM, Shawn Milochik wrote: > C. The Celery daemon polls the broker regularly, looking for tasks. i hope this isn't polling, but a signal initiated by the broker. -- Javier -- You received this message because you are subscribed to the Google

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread ringemup
Thank you for taking the time to explain that, Shawn -- it makes everything a LOT clearer. If you could spare the time, I'm curious about a couple of aspects of the architecture: - What is the purpose of having a separate broker and daemon? - How does the broker know when to pass the task back

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 4:11 PM, ringemup wrote: > >> It's surprisingly easy to get set up with nothing more than the >> tutorial/into for django-celery. If anyone has problems with it I'd be happy >> to try to assist. > > Thanks, I might take you up on that. > >> Although getting everything

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Brian Bouterse
I would be willing to give an overview. Basically you should: 1) yum or apt-get install rabbitMQ 2) make sure the service is started. 3) Set up your broker by running these 3 commands . 4) pip install

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread ringemup
> It's surprisingly easy to get set up with nothing more than the tutorial/into > for django-celery. If anyone has problems with it I'd be happy to try to > assist. Thanks, I might take you up on that. > Although getting everything working is fairly easy, in my opinion the docs > aren't too

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Shawn Milochik
On Oct 13, 2010, at 1:58 PM, Brian Bouterse wrote: > I have found cron to be a poor solution for this although it is tempting > since it is so easy and will get you started right away. What I observe > happens is, basically someone puts the cron job in crontab, and then a lot of > time

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Nick Arnett
On Wed, Oct 13, 2010 at 4:38 AM, Mattias Linnap wrote: > Hi Django users, > > I'm building an application with Django, and I need some database > changes to occur at certain times in the future - independently of any > web request. Things like cleaning up expired sessions,

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Brian Bouterse
I have found cron to be a poor solution for this although it is tempting since it is so easy and will get you started right away. What I observe happens is, basically someone puts the cron job in crontab, and then a lot of time passes, and folks forget which machine in the cluster is actually in

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Ethan Poole
Another technique, that I feel should be pointed out, is a custom django-admin command: http://docs.djangoproject.com/en/dev/howto/custom-management-commands/. If you are going to use a crontab to run a Python script, this is by far the easiest way to do it. On 13 Okt, 10:53, ringemup

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread ringemup
You can also use this technique[1] to create a python script that you can call from your crontab. Basically, you can call anything in Django from any Python script as long as you set the DJANGO_SETTINGS_MODULE environment variable first and have Django, your project, and your apps on your path.

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Jo
On 13 ?.?. 2010, at 18:50, Jonathan Barratt wrote: > On 13 ?.?. 2010, at 18:38, Mattias Linnap wrote: > >> Hi Django users, >> >> I'm building an application with Django, and I need some database >> changes to occur at certain times in the future - independently of any >> web request. Things

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Tom Evans
On Wed, Oct 13, 2010 at 12:38 PM, Mattias Linnap wrote: > Hi Django users, > > I'm building an application with Django, and I need some database > changes to occur at certain times in the future - independently of any > web request. Things like cleaning up expired sessions,

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Brian Bouterse
You really should take a look at django-celery. It is the right tool for this job IMHO. Brian On Wed, Oct 13, 2010 at 7:38 AM, Mattias Linnap wrote: > Hi Django users, > > I'm building an

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Jonathan Barratt
On 13 ต.ค. 2010, at 18:38, Mattias Linnap wrote: > Hi Django users, > > I'm building an application with Django, and I need some database > changes to occur at certain times in the future - independently of any > web request. Things like cleaning up expired sessions, deleting > expired user

What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Mattias Linnap
Hi Django users, I'm building an application with Django, and I need some database changes to occur at certain times in the future - independently of any web request. Things like cleaning up expired sessions, deleting expired user actions, etc. What is the best way to implement those? 1) Make a