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

Reply via email to