With the hint from SAE Python maintainer, I use __file__ to solve the
path problem.

$ pwd
~/src/web2py_sae/3
$ gvim config.py &
import os
app_root = os.path.dirname(__file__)
$ gvim gluon/main.py &
from config import app_root
version_path = os.path.join(app_root, 'VERSION')
version_info = open(version_path)

Now the problem is still the 'invalid request' without python error.
How can I find the log?
http://web2py.sinaapp.com/welcome/default/index
http://web2py.sinaapp.com/debug

thx!

On Nov 8, 10:53 pm, chinakr <[email protected]> wrote:
> My new index.wsgi is as follow:
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import sae
>
> from gluon.settings import global_settings
> global_settings.web2py_runtime_gae = True
>
> import gluon.main
>
> app = gluon.main.wsgibase
> application = sae.create_wsgi_app(app)
> #application = app
>
> And I also have to disable open function in gluon/main.py:
>
> #version_info = open(abspath('VERSION', gluon=True), 'r')
> #version_info = open('../VERSION')
> version_info = 'Version 1.99.2 (2011-09-26 06:55:33) stable'
> #web2py_version = parse_version(version_info.read().strip())
> web2py_version = parse_version(version_info)
> #version_info.close()
> global_settings.web2py_version = web2py_version
>
> Now the error is still 'invalid 
> request':http://web2py.sinaapp.com/welcome/default/indexhttp://web2py.sinaapp.com/debug
>
> What should I do know?
>
> On Nov 7, 10:30 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > Try this:
>
> > import sae
> > import gluon.main
> > from gluon.settings import global_settings
> > global_settings.web2py_runtime_gae = True
> > application = gluon.main.wsgibase
>
> > On Nov 7, 1:57 am, chinakr <[email protected]> wrote:
>
> > > SAE means Sina App Engine, which is a public cloud computing platform
> > > like GAE. It's the most mature and famous public cloud in China, where
> > > people can't access GAE freely. SAE only supports PHP in the last 3
> > > years.
>
> > > Recently, SAE started internal testing with Python support, with code
> > > name SAE Python.
>
> > > I would like to deploy web2py on SAE Python. And as GAE, SAE Python
> > > doesn't provide local file I/O, etc. I have to modify a lot of things
> > > manually.
>
> > > As lack of experience and time, it seems a hard task for me. So anyone
> > > can help?
>
> > >http://3.web2py.sinaapp.com/welcome/default/index
> > > will get 'invalid request' message with following index.wsgi:
>
> > > import sae
> > > import gluon.main
>
> > > app = gluon.main.wsgibase
> > > application = sae.create_wsgi_app(app)
>
> > > I also comment mkdir and open code in main.py.
>
> > > SAE Python 
> > > documents:http://appstack.sinaapp.com/static/doc/release/testing/index.html

Reply via email to