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 delivery of messages.  The b

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 fr

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 This could very well

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 dae

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 Groups "Django users"

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 to

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 wor

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 djan

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 c

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 passes

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, deleting > expired user

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 c

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 wrote: > Y

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 lik

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, deleting > expired user

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 application with Djang

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 actio

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 s

Re: cronjob

2007-09-18 Thread Ramiro Morales
On 9/18/07, patrickk <[EMAIL PROTECTED]> wrote: > > now I get: > ImportError: No module named django.core.management > > the directory "django_src" is on my python-path. > Read cron documentation; the cronjobs run with a crippled environment but you can set/add the env vars (PYHTONPATH in this ca

Re: cronjob

2007-09-18 Thread Horst Gutmann
on my python-path. > > > On 18 Sep., 12:43, Christian Joergensen <[EMAIL PROTECTED]> wrote: > > patrickk wrote: > > > I just tried to set up a cronjob with plesk and I got this error: > > > > > from: can't read /var/mail/django.core.management >

Re: cronjob

2007-09-18 Thread Nis Jørgensen
patrickk skrev: > now I get: > ImportError: No module named django.core.management > > the directory "django_src" is on my python-path. > It probably isn't on cron's python-path, though. Try adding PYTHONPATH=/your/python/path to the top of your crontab. -- Nis Jørgensen Who is NOT a relati

Re: cronjob

2007-09-18 Thread patrickk
now I get: ImportError: No module named django.core.management the directory "django_src" is on my python-path. On 18 Sep., 12:43, Christian Joergensen <[EMAIL PROTECTED]> wrote: > patrickk wrote: > > I just tried to set up a cronjob with plesk and I got this error: &g

Re: cronjob

2007-09-18 Thread Christian Joergensen
patrickk wrote: > I just tried to set up a cronjob with plesk and I got this error: > > from: can't read /var/mail/django.core.management > /var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line > 4: import: command not found > /var/www/vhosts/mydomain.

cronjob

2007-09-18 Thread patrickk
I just tried to set up a cronjob with plesk and I got this error: from: can't read /var/mail/django.core.management /var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line 4: import: command not found /var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line 5: s