views:

31

answers:

2

I have a appengine webapp where i need to set HTTP Location variable to redirect to another page in the same webapp. For that i need to produce a absolute link. for portability reason i cannot use directly the domain name which i am currently using.

Is it possible to produce the domain name on which the webapp is hosted in the python code.

+1  A: 

I don't think I quite fully understand the need to getdomain name. But check out if redirect API provided by google app engine will do the job. http://code.google.com/appengine/docs/python/tools/webapp/redirects.html

Ashish
thanks! it helped.. :)
Idlecool
+1  A: 

If you're using the webapp framework, the current URL is in self.request.url. Various components are broken out in properties of self.request, documented here.

Nick Johnson