Hi Graham, > I presume you will be at my talk?
Yes. > You don't need to remap stdout if using mod_wsgi 3.0+. See: > http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output... Ah, thanks. > > settings = __import__(locals().get('SETTINGS_MODULE_NAME', > > 'settings')) > > > import version_loader > > version_loader.load(settings.VERSIONS) > > Can you explain what the above with the __import__ and version_loader > is intending to achieve? > > Is that something of your own? Yes; in my django settings modules I have an optional VERSIONS dictionary; for example: VERSIONS = { 'django': '1.1', 'django-cms': '2.0', } Then for each project, I have a WSGI script that looks something like: PROJECT_NAME = 'my_project_name' SETTINGS_MODULE_NAME = 'non_standard_settings' # rarely required import os execfile(os.path.join(os.path.dirname(__file__), 'standard.wsgi')) Where standard.wsgi is the script I included previously -- this keeps all the common code in one place. The version_loader checks the VERSIONS dictionary and adds the appropriate paths to sys.path. I have found that this approach is much easier to maintain than a virtualenv for every project. Cheers, Simon -- 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.
