All pastes #825497 Raw Edit

Unnamed

public text v1 · immutable
#825497 ·published 2007-12-20 16:56 UTC
rendered paste body
if __name__ == '__main__':
    global_conf = {'engine.autoreload_on' : True,
                   'server.socket_port' : 7200,
                   'server.socket_host': '127.0.0.1' }

    cherrypy.config.update({ 'global' : global_conf })
    cherrypy.checker.on = False

    prefix = '/{profile}'
    app = Main(app_conf)
    app = profile.ProfileMiddleware(app_conf['profile_index'], app,
                                    prefix=prefix)
    app = SessionMiddleware(app)
    app = IndexXMLMiddleware(app_conf, app)
    app = TemplateMiddleware(app_conf, app)
    app = HTTPExceptionMiddleware(app)
    if app_conf.get('debug'):
        # each app should use this but for debugging/dev this is
        # appropriate
        app = EvalException(app)

    cherrypy.tree.graft(app, script_name='/')

    from openidgateway import make_openidgateway
    openidgateway_conf = {
        'debug': True,
        'base_url': 'http://127.0.0.1:7200/gatekeeper/',
        'host': '127.0.0.1',
        'xsltemplate_namespace': 'http://ionrock.org/python/xsltemplates/',
    }
    
    gateway = make_openidgateway(openidgateway_conf)
    
    cherrypy.tree.graft(gateway, script_name='/gatekeeper')

    cherrypy.tree.graft(
        make_static({}, 'templates/static/page'), script_name='/page'
    )
    cherrypy.tree.graft(
        make_static({}, 'templates/static'), script_name='/static'
    )
    cherrypy.tree.graft(
        make_static({}, 'templates/static/css'), script_name='/css'
    )

    
    cherrypy.server.quickstart()
    try:
        cherrypy.engine.start()
    except KeyboardInterrupt:
        cherrypy.engine.stop()