I'm kind of a newbie at this (web applications, that is, not Python
programming), so I'd appreciate any advice others can offer.

I'm developing a Django app (post-M-R) that will communicate by email with
some remote hosts (which are running archaic software that can't easily be
updated to use some more modern form of communication), and then take
information from the emails and insert it into the database.  I can handle
writing a Thread class that will poll the inbox periodically and process
each of the messages it finds to create and save the appropriate model
objects to the database.

My question is, how can I launch this background daemon process so that I
can be reasonably sure that there will always be one and only one instance
of it running at any given time?  I don't see any obvious "hook" in the
Django code for running something when the server is first started up.  It
seems to me that modules like models.py, views.py etc. get imported multiple
times so that there would be too many threads running if I tried to put it
in one of these modules.

Is this something that needs to be done within the webserver?  If so, how?
(I'm using the Django dev server for now but plan to switch to Apache for
production.) And I also need some "hook" that will let me restart the daemon
if it has crashed for some reason...

Thanks in advance for any suggestions.

Russ Blau




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to