Reputation: 437
does someone have an idea how to get the environment variables on Google-AppEngine ?
I'm trying to write a simple Script that shall use the Client-IP (for Authentication) and a parameter (geturl or so) from the URL (for e.g. http://thingy.appspot.dom/index?geturl=www.google.at
)
I red that i should be able to get the Client-IP via "request.remote_addr" but i seem to lack 'request' even tho i imported webapp from google.appengine.ext
Many thanks in advance, Birt
Upvotes: 0
Views: 472
Reputation: 89847
To answer the actual question from the title of your post, assuming you're still wondering: to get environment variables, simple import os
and the environment is available in os.environ
.
Upvotes: 3
Reputation: 1360
In short, assuming you're using webapp: you can get the client ip address via self.request.remote_addr and the parameter with self.request.get("geturl")
See the Handling Forms with webapp section of the tutorial.
Upvotes: 2
Reputation: 8109
Are you using webapp or doing CGI-style? The webapp request class is documented at the appengine docs.
Upvotes: 1