Hi, Bobby Roberts wrote:
On Sep 23, 9:10 am, Tino Wildenhain <[EMAIL PROTECTED]> 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"] -- GerhardYeah 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.
...
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).
Its a snap in all python based web apps I ever saw. You didn't tell us what you actually using so we can't say. Also there is no notation of "url beeing viewed" in HTTP if you are looking from server's point of view. There is a request for an URI and a host where the request is directed at then then the server decides to publish a resource based on whatever rules. If that publishing results in a call to your python script (or the script itself is the server) then you would deal with whatever interface API you decided to use gives you. Ah and last not least you can even use python in ASP (look for scripting host) but's not a route to take these days :-) (You really want no inline code but a decent templating engine like PageTemplates (TAL)) Tino
smime.p7s
Description: S/MIME Cryptographic Signature
-- http://mail.python.org/mailman/listinfo/python-list