On Wed, Mar 18, 2009 at 11:48 AM, Graham Dumpleton <[email protected]> wrote: > > 2009/3/18 Nimrod A. Abing <[email protected]>: >> >> I was looking at following section in the Wiki docs: >> >> http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Restarting_Daemon_Processes >> >> The code snippet in question is: >> >> if environ['mod_wsgi.process_group'] != '': >> import signal, os >> os.kill(os.getpid(), signal.SIGINT) > > The 'environ' name here relates to the 'environ' argument passed to > the WSGI application. Ie., assumed that this code appears in context > where that was being passed through to it.
I was trying to access it from inside a Django view and just now found out that it's in the HttpRequest.META dictionary. Thanks for clearing this up. >> using just plain "environ" raises NameError exception. Using >> "os.environ" raises KeyError exception. I would also like to note that >> the source for "monitor.py" found in the same section does not make >> use of the above code snippet. > > Yes, that is correct, as in current versions of mod_wsgi there is no > way to determine outside context of a request, eg., as code triggered > by import, whether it is daemon mode process or not. > > In mod_wsgi 3.0, plus going to be back ported to mod_wsgi 2.4, you > will be able to do: > > import mod_wsgi > if mod_wsgi.process_group != '': > ... > > See: > > http://code.google.com/p/modwsgi/issues/detail?id=27 Looking forward to it. Thanks. -- Best Regards, Nimrod A. Abing W http://arsenic.ph/ W http://preownedcar.com/ W http://preownedbike.com/ W http://abing.gotdns.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
