For any one novice with Web2py like me :) here are some time saver: 1. In app-engine - urllib2.urlopen(url) can only allow access to outside url. anything within the app will give exception
2. I guess same thing might be applied to service (e.g. XMLRPC), have not tested though. 3. You can not import model, controller form another application. You can Import Module *** 4. In app-engine you can not have model with the same name in different application Best way to communicate with other app is by importing module from that app. Really like this approach, though it needed some time to find out. Tested this on App-engine local server. Here is how to import module: http://www.web2py.com/book/default/chapter/04 pls go to the section "Accessing the API from Python modules" :) On Jan 30, 3:02 pm, sabbir <sabbir...@gmail.com> wrote: > Hi All, > > I have two app in the same gae deployment. Inter app communication I > planned to do through httpget as always, for its simplicity. While > implementing this I have noticed that I can fetch any url except of my > own deployments. > > ------- Code sample > > url = 'http://localhost:8080/welcome/default/index'# this raise error > url = 'http://google.com'# this is fine > > result= urllib2.urlopen(url) > # this raise a exception here if URL points to the any app in the > web2py deployment > > result= result.read() > return result > > ---------------------------- here is the exception detail > Traceback (most recent call last): > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 4113, in _HandleRequest > self._Dispatch(dispatcher, self.rfile, outfile, env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 4022, in _Dispatch > base_env_dict=env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 596, in Dispatch > base_env_dict=base_env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 3095, in Dispatch > self._module_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 2999, in ExecuteCGI > reset_modules = exec_script(handler_path, cgi_path, hook) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 2864, in ExecuteOrImportScript > script_module.main() > File "D:\web2py_src\web2py\gaehandler.py", line 110, in main > run_wsgi_app(wsgiapp) > File "C:\Program Files\Google\google_appengine\google\appengine\ext > \webapp\util.py", line 98, in run_wsgi_app > run_bare_wsgi_app(add_wsgi_middleware(application)) > File "C:\Program Files\Google\google_appengine\google\appengine\ext > \webapp\util.py", line 119, in run_bare_wsgi_app > sys.stdout.write(data) > TypeError: must be string or read-only character buffer, not type > > ---------------------------- > > I am planning to solve this Inter app communication using raw python > code and GQL as I also cant access model of another app. Is there any > best practice in this case? > > Thanks and regards, > sabbir