﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18559	os.environ.setdefault: Documentation should warn against being incompatible with multiple sub interpreter processes	benjaoming	nobody	"There is a problem with the auto-generated wsgi.py because in its attempt to allow for external configurations of the environment, it should clearly warn users that it is not per default able to handle multiple environments when for instance running many virtualhosts with Apache.

With all respects to [https://code.djangoproject.com/ticket/18518 ""this wontfix #18518""], I think the documentation should be very explicit about users configuring their DJANGO_SETTINGS_MODULE somewhere outside of wsgi.py (or editing wsgi.py). This is a very annoying bug because it shows up randomly and is very hard to debug.

[https://groups.google.com/forum/?fromgroups#!topic/modwsgi/0pLZs39gQ7k ""As the author of modwsgi notes:""]

""If the auto generated wsgi.py is using setdefault they have broken it very badly. When running in a multiple sub interpreter process, the first wsgi.py in any sub interpreter will win for the whole process. This is because setting os.environ, pushes values back out to process scope and when next sub interpreter is created it will pick up the value of the environment variable leaked from the other sub interpreter."""	Bug	closed	Documentation	1.4	Normal	duplicate	os.environ wsgi	Graham Dumpleton	Unreviewed	0	0	0	0	1	0
