On Jul 15, 9:54 pm, "Ian Lawrence" <[EMAIL PROTECTED]> wrote: > Hi, > I am experimenting with wsgi. I saw that this can be one way to enable it: > > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > this seems a little strange to me setting something global to your > process. Is this best practice on the mod_wsgi world?
Some see it as acceptable some don't. The downside of relying on global data like this, is that one can't host two instances of Django within the same Python interpreter. This means you have to run them in separate processes, or use the ability of mod_python or mod_wsgi to create distinct sub interpreters within a process and run Django instances in the distinct sub interpreters. Either way, the result is two copies in memory of all common code modules. In contrast, look at Trac which is regarded as being more WSGI friendly, and you can specify its configuration settings through the per request WSGI environment. Because of that and because they avoid other global data, or at least have it keyed off per request configuration, it is possible to host multiple Trac project instances in same interpreter, thus getting a saving of memory through use of common loaded code modules etc. 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 -~----------~----~----~----~------~----~------~--~---