finding domain name

Tino Wildenhain tino at wildenhain.de
Tue Sep 23 15:10:28 CEST 2008


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.

Regards
Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20080923/1555a9de/attachment.bin>


More information about the Python-list mailing list