I was thinking of making settings.py start the process but this seemed slightly ugly.
I don't really want to make make custom start up scripts, nor can I really make the starting of this process lazy.
I was thinking of making settings.py start the process but this seemed slightly ugly.
I don't really want to make make custom start up scripts, nor can I really make the starting of this process lazy.
You might be able to register a listener to the "class-prepared" signal on one of your model classes and fire your process from there. However, I think the need to do this is most likely a design smell, or a case of the tail wagging the dog.
http://docs.djangoproject.com/en/dev/ref/signals/#class-prepared
I'd be curious to know why your design calls for this, but that may get us off-topic here.