we are at the edge of my knowledge here, but the things that might be
important to you from gae_handler.py:
path = os.path.dirname(os.path.abspath(__file__))
sys.path = [path]+[p for p in sys.path if not p==path]
from gluon.settings import global_settings
global_settings.web2py_runtime_gae = True
global_settings.db_sessions = True
if os.environ.get('SERVER_SOFTWARE', '').startswith('Devel'):
(global_settings.web2py_runtime, DEBUG) = \
('gae:development', True)
else:
(global_settings.web2py_runtime, DEBUG) = \
('gae:production', False)
import gluon.main
env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
#this deals with a problem where GAE development server seems to forget
# the path between requests
if global_settings.web2py_runtime == 'gae:development':
gluon.admin.create_missing_folders()
from gluon.custom_import import custom_import_install
web2py_path = global_settings.applications_parent # backward
compatibility
custom_import_install(web2py_path)
those lines (or some combination thereof) setup the web2py path and
environment. you might also need to call gluon.main to get request and
response setup. perhaps you will need to do that as a wsgi middleware?
good luck! sorry i don't have the experience to be more helpful.
cfh