My django project consists of a lot of apps, libraries and middleware. I would like to run different configurations of this project on different virtual hosts (because of different use cases and needs, for example: one for users, one for M2M api, etc). From this question I understand that it should not be a problem to host this, as long as I have separate wsgi bootstrap files, but I don't understand why the following line:
os.environ['DJANGO_SETTINGS_MODULE'] = 'site1.settings'
does not cause an error with simultaneous deployments. If I have several virtual hosts with their own wsgi config files, all of which set up the DJANGO_SETTINGS_MODULE system variable, don't they overwrite each other's setting?
Does this setting get changed "just-in-time" on every request? In that case, is there a more efficient way of handling such multi-host setup?
Thanks,