--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To post to this group, send email to pywe...@googlegroups.com.
To unsubscribe from this group, send email to pyweb-il+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyweb-il?hl=en.
Just one comment to Oz's correct (IMHO) note:
On Tuesday 26 October 2010, oz katz wrote:
>
> I wouldn't run something like that as a thread on my web server.
> I would implement it as an all together separate process that does the
> polling and updates the DB.
> this could of course be a Django stand alone script.
The natural place for it would be a management command.
I don't quite understand the "run once at startup" thing; I can't think of a situation where I'd want to run something django-related just once for a given server.
However, if you do have such a use-case, then yes -- a django management command is the way to go. It will make your life simpler since management commands already run in a viable django context. You simply need to trigger a script upon server start that executes "manage.py yourcommand". If your task is repeating, then run the management command from within a cron.
-I