On Aug 24, 6:23 am, George Vilches <[EMAIL PROTECTED]> wrote:
> James Bennett wrote:
> > On 8/23/07, John Menerick <[EMAIL PROTECTED]> wrote:
> >> Yeah, I was thinking of running a script in daemon mode, but I would prefer
> >> to keep the code inside the django instance to keep everything simpler.
> >> simpler as in the same settings for deployment, less hassle deploying on
> >> machines, etc....
>
> > But at the same time, this is *not* something Django is designed to
> > do. On the other hand, it *is* something cron is both designed to do
> > and quite good at. Django is not a replacement for the operating
> > system ;)
>
> Even more importantly, most of the ways that Django is run are not
> reliable ways to ensure that Django is always in memory (see:
> mod_python), so it would be very hard to do this with any amount of
> accuracy or permanency.

Also, with mod_python on UNIX you would have a multiprocess web
server. If therefore you did it within Django, you could have it being
down in multiple processes at the same time. If it is something that
operates on the database it could be quite bad as they may stuff each
other up. You also risk with mod_python your operation being killed
off when half done if Apache processes are being shutdown. Therefore
somewhat safer to control from outside of the application.

A compromise may be to have a cron job which triggers an XML-RPC
request against web server to have Django do it. That way in a multi
process web server, at least only one process will be doing it at a
time.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to