In mod_wsgi values set with SetEnv are only passed into the per
request WSGI environ dictionary.

That such variables were even set in os.environ was nothing to do with
mod_python but the mod_python adapter in Django. What Django was doing
was flawed. Not only were os.environ variables being reset on every
request, in a multithreaded application if set differently for
different contexts in same application could cause thread race
conditions.

In short, you should not rely on being able to set os.environ
variables on a per request basis.

The proper approach is to set them in the WSGI script file:

  import os
  os.environ['VAR'] = 'value'

Graham

On 23 August 2011 22:10, Frederik Vogelsang
<[email protected]> wrote:
> Hi,
>
> I am migrating a project from mod_python to mod_wsgi. It is basically
> a Django application which is protected by Shibboleth. Now Shibboleth
> sets some environment variables which are required for the Django app
> to function properly. With mod_python the environment is being passed
> to the Python application. But after migrating to mod_wsgi I do not
> see any relevant information through os.environ any more. Neither in
> the wsgi-script nor in the rest of the app.
>
> Is this expected? Is there a configuration parameter which I missed?
>
>
> Regards,
> Frederik
>
> --
> 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.
>
>

-- 
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.

Reply via email to