How do I get the port no on the server (on which web2py app is deployed) from inside the web2py application (for ex. controller or module)?
I am using urllib to interact with another action inside the controller by doing this
response = urllib2.urlopen('http://127.0.0.1:8000%s?%s'%(URL('unregister_relationship.json'),urllib.urlencode(data)))
response = json.loads(response.read())
but this needs port no to be known beforehand, I want it to be dynamic.