On Wednesday, July 4, 2012 12:05:36 AM UTC+2, Graham Dumpleton wrote:
>
>
>
> 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.
>
> I will have to look at original Django and if this is what they are doing, 
> then yell a people about it.
>
> To fix, don't use setdefault. Just use '=' to set value in os.environ.
>
> Graham
>

Thanks, I will try with this solution ASAP and I think indeed judging from 
the symptoms that this was the sole cause.

The Django people have written their documentation about WSGI here:

https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/

I think it should clearly mention that this can have harmful effects, 
unfortunately it doesn't, and there is a wontfix on the issue here: 
https://code.djangoproject.com/ticket/18518

I'll open up a ticket for the documentation instead.

Thanks again,
Benjamin

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/wfDSMNP0vdcJ.
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.

Reply via email to