[Zope] Environment Variable

Martijn Pieters mj@digicool.com
Thu, 20 Jan 2000 15:33:37 -0500


> -----Original Message-----
> From: Michel Pelletier [mailto:michel@digicool.com]
> > -----Original Message-----
> > From: Daniel G. Rusch [mailto:drusch@globalcrossing.com]
> > Hey all, 
> > 
> > I'm strecthing my area of expertise here, but I had our sys 
> > admin set an
> > Environment Variable in etc/profile and a different 
> > Environment Variable
> > in Apache. I don't seem to be able to access either. 
> > I've tried <dtml-var "REQUEST['varname']">, but that throws 
> > an KeyError.
> > Any thoughts.
> 
> It looks like there is no generic DTML inteface to env variables, the
> REQUEST obj does get some env vars but only those defined in the CGI
> spec.
> 
> I suspect the easiest solution is to write an external method that
> examines your environment.
> 
> import os
> 
> def getEnvVar(var):
>   return os.environ[var]
> 
> or something like that.

And if you want to have a quick peak at what actually is in REQUEST,
just add it to the URL, like www.yourserver.dom/REQUEST

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------