Exemplo n.º 1
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    # Update the settings with the current app root path
    settings['app_root'] = abspath(dirname(dirname(__file__)))

    initialize_sql(settings)

    authn_policy = AuthTktAuthenticationPolicy(
        settings.get('auth.secret'),
        callback=UserMgr.auth_groupfinder)
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(settings=settings,
                          root_factory='bookie.RootFactory',
                          authentication_policy=authn_policy,
                          authorization_policy=authz_policy)
    config.set_request_factory(RequestWithUserAttribute)

    config = build_routes(config)
    config.add_static_view('static', 'bookie:static')
    config.scan('bookie.views')

    return config.make_wsgi_app()
Exemplo n.º 2
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    # Update the settings with the current app root path
    settings["app_root"] = abspath(dirname(dirname(__file__)))

    initialize_sql(settings)

    authn_policy = AuthTktAuthenticationPolicy(settings.get("auth.secret"), callback=UserMgr.auth_groupfinder)
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(
        settings=settings,
        root_factory="bookie.RootFactory",
        authentication_policy=authn_policy,
        authorization_policy=authz_policy,
    )
    config.set_request_factory(RequestWithUserAttribute)

    config = build_routes(config)
    config.add_static_view("static", "bookie:static")
    config.add_renderer("jsonp", JSONP(param_name="callback"))
    config.scan("bookie.views")

    return config.make_wsgi_app()
Exemplo n.º 3
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    # Update the settings with the current app root path
    settings['app_root'] = abspath(dirname(dirname(__file__)))

    initialize_sql(settings)

    authn_policy = AuthTktAuthenticationPolicy(
        settings.get('auth.secret'), callback=UserMgr.auth_groupfinder)
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(settings=settings,
                          root_factory='bookie.RootFactory',
                          authentication_policy=authn_policy,
                          authorization_policy=authz_policy)
    config.set_request_factory(RequestWithUserAttribute)

    config = build_routes(config)
    config.add_static_view('static', 'bookie:static')
    config.add_renderer('jsonp', JSONP(param_name='callback'))
    config.scan('bookie.views')

    return config.make_wsgi_app()
Exemplo n.º 4
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    initialize_sql(engine)
    config = Configurator(settings=settings)
    config.add_static_view('static', 'bookie:static')

    config = build_routes(config)
    return config.make_wsgi_app()
Exemplo n.º 5
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    initialize_sql(engine)

    unencrypt = UnencryptedCookieSessionFactoryConfig('itsaseekreet')

    config = Configurator(settings=settings, session_factory=unencrypt)
    config = build_routes(config)
    config.add_static_view('static', 'bookie:static')

    return config.make_wsgi_app()
Exemplo n.º 6
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    initialize_sql(engine)

    authn_policy = AuthTktAuthenticationPolicy(
                       settings.get('auth.secret'),
                       callback=UserMgr.auth_groupfinder)
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(settings=settings,
                          root_factory='bookie.RootFactory',
                          authentication_policy=authn_policy,
                          authorization_policy=authz_policy)
    config.set_request_factory(RequestWithUserAttribute)

    config = build_routes(config)
    config.add_static_view('static', 'bookie:static')
    config.scan('bookie.views')

    return config.make_wsgi_app()
Exemplo n.º 7
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    initialize_sql(settings)

    authn_policy = AuthTktAuthenticationPolicy(
                       settings.get('auth.secret'),
                       callback=UserMgr.auth_groupfinder)
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(settings=settings,
                          root_factory='bookie.RootFactory',
                          authentication_policy=authn_policy,
                          authorization_policy=authz_policy)
    config.set_request_factory(RequestWithUserAttribute)

    import bookie.bcelery.celeryapp
    bookie.bcelery.celeryapp.load_config(settings)

    config = build_routes(config)
    config.add_static_view('static', 'bookie:static')
    config.scan('bookie.views')

    return config.make_wsgi_app()