finding domain name
tchendrix at gmail.com
Tue Sep 23 16:53:03 CEST 2008
On Sep 23, 9:10 am, Tino Wildenhain <t... at wildenhain.de> wrote:
> Bobby Roberts wrote:
> >> Depends on the technology/web framework. If you use WSGI, you should use
> >> something like:
> >> host_name = environ.get("HTTP_HOST", None) or environ["SERVER_NAME"]
> >> -- Gerhard
> > Yeah i already tried environ("SERVER_NAME") but get a key error when i
> > do.
> You could output the whole environ to see what you get and how it is called.
> I'd recommend however to check that you are using a configured value and
> not something sent by the client if you are going to use it during
> filesystem lookup.
evidently the environ dictionary is off limits on our server. It can't
be that tough in python to get the current complete url being viewed.
It's a snap in asp(which is my background).
More information about the Python-list