On Thu, Aug 19, 2010 at 9:45 PM, buddhasystem <potek...@bnl.gov> wrote: > Thank you! I actually had something less fancy in mind, like initializing > data structures (possibly from a file), when the server is starts. > Basically, looking for "init" handle.
point is, in a 'shared nothing' architecture, you don't know (nor care) how many instances of the server are running. those data structures you mention, are memory structures, reside on the database, or maybe on shared cache (like memcached)? if they have to be single instances for the whole system, they must reside on a shared resource; that is database or cache. for that, you should handle out of Django, like hcarvalhoalves suggested. if they are memory (python) structures, bear in mind that each server instance would have its own copy. if you still want these, just call the constructor function from an appropriate file, maybe urls.py or models.py by the way; if you think 'multiple servers' would only apply for a big deployment, remember that mod_wsgi and even flup can start multiple Django processes, kill them and restart them at will to better serve varying user demand. it's very seldom wise to 'hook' on that life cycle. -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.