Example #1
0
logging.basicConfig(level=logging.INFO)


def wsgiapp(env, res):
    """Return the wsgiapp"""
    env['PATH_INFO'] = env['PATH_INFO'].decode('latin1').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)

    return gluon.main.wsgibase(env, res)


if LOG_STATS or DEBUG:
    wsgiapp = log_stats(wsgiapp)


def main():
    """Run the wsgi app"""
    run_wsgi_app(wsgiapp)


if __name__ == '__main__':
    main()
Example #2
0

def wsgiapp(env, res):
    """Return the wsgiapp"""
    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)

    return gluon.main.wsgibase(env, res)


if LOG_STATS or DEBUG:
    wsgiapp = log_stats(wsgiapp)


def main():
    """Run the wsgi app"""
    run_wsgi_app(wsgiapp)


if __name__ == "__main__":
    main()