コード例 #1
0
ファイル: __init__.py プロジェクト: kashifpk/droneos
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    load_project_settings()

    session_factory = UnencryptedCookieSessionFactoryConfig(settings.get('session.secret', 'hello'))

    engine = engine_from_config(settings, 'sqlalchemy.')
    db.configure(bind=engine)
    config = Configurator(session_factory=session_factory, settings=settings)
    config.add_tween('droneos_ui.auth.authenticator')
    config.include('pyramid_handlers')
    config.add_view('pyramid.view.append_slash_notfound_view',
                context='pyramid.httpexceptions.HTTPNotFound')

    add_admin_handler(config, db, get_models(droneos_ui), 'admin.', '/admin', AdminController)

    application_routes(config)
    configure_app_routes(config)

    all_apps = get_submodules(apps)

    ignored_apps = []
    for app in all_apps:
        if app['is_package'] and app['name'] not in enabled_apps:
            ignored_apps.append('.apps.' + app['name'])

    config.scan(ignore=ignored_apps)

    return config.make_wsgi_app()
コード例 #2
0
ファイル: __init__.py プロジェクト: kashifpk/blogs_compulife
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    load_project_settings()

    session_factory = UnencryptedCookieSessionFactoryConfig(
        settings.get('session.secret', 'hello'))

    engine = engine_from_config(settings, 'sqlalchemy.')
    db.configure(bind=engine)
    config = Configurator(session_factory=session_factory, settings=settings)
    config.add_tween('blogs_compulife.auth.authenticator')
    config.include('pyramid_mako')
    config.add_view('pyramid.view.append_slash_notfound_view',
                    context='pyramid.httpexceptions.HTTPNotFound')

    add_admin_handler(config, db, get_models(blogs_compulife,
                                             return_dict=True), 'admin.',
                      '/admin', AdminController)

    application_routes(config)
    configure_app_routes(config)

    all_apps = get_submodules(apps)

    ignored_apps = []
    enabled_app_names = [subapp.APP_NAME for subapp in enabled_apps]
    for app in all_apps:
        if app['is_package'] and app['name'] not in enabled_app_names:
            ignored_apps.append('.apps.' + app['name'])

    config.scan(ignore=ignored_apps)

    return config.make_wsgi_app()
コード例 #3
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    load_project_settings()

    session_factory = UnencryptedCookieSessionFactoryConfig(settings.get('session.secret', 'hello'))

    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    config = Configurator(session_factory=session_factory, settings=settings)
    config.add_tween('giteverywhere.auth.authenticator')
    config.include('pyramid_handlers')
    config.add_view('pyramid.view.append_slash_notfound_view',
                context='pyramid.httpexceptions.HTTPNotFound')
    config.add_static_view('static', 'static', cache_max_age=3600)

    config.add_route('home', '/')
    config.add_route('contact', '/contact')
    config.add_route('pyckauth_login', '/login')
    config.add_route('pyckauth_logout', '/logout')
    config.add_route('pyckauth_manager', '/auth')
    config.add_route('pyckauth_users', '/auth/users')
    config.add_route('pyckauth_permissions', '/auth/permissions')
    config.add_route('pyckauth_routes', '/auth/routes')
   


    add_admin_handler(config, DBSession, get_models(giteverywhere), 'admin.', '/admin', AdminController)  
    configure_app_routes(config)

    config.scan()

    return config.make_wsgi_app()
コード例 #4
0
ファイル: __init__.py プロジェクト: kashifpk/smpp5
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    load_project_settings()

    session_factory = UnencryptedCookieSessionFactoryConfig(settings.get('session.secret', 'hello'))

    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    config = Configurator(session_factory=session_factory, settings=settings)
    config.add_tween('smpp5web.auth.authenticator')
    config.include('pyramid_handlers')
    config.add_view('pyramid.view.append_slash_notfound_view',
                context='pyramid.httpexceptions.HTTPNotFound')
    config.add_static_view('static', 'static', cache_max_age=3600)

    config.add_route('home', '/')
    config.add_route('contact', '/contact')
    config.add_route('sms_in', '/sms_in')
    config.add_route('main_page', '/main_page')
    config.add_route('admin_page', '/admin_page')
    config.add_route('sms_history', '/sms_history')
    config.add_route('billing', '/billing')
    config.add_route('weeklygraphs', '/weeklygraphs')
    config.add_route('dailygraphs', '/dailygraphs')
    config.add_route('monthlygraphs', '/monthlygraphs')
    config.add_route('usermonthlygraphs', '/usermonthlygraphs')
    config.add_route('useryearlygraphs', '/useryearlygraphs')
    config.add_route('packages', '/packages')
    config.add_route('select_packages', '/select_packages')
    config.add_route('reset_password', '/reset_password')
    config.add_route('display_users', '/display_users')
    config.add_route('sms_history_admin', '/sms_history_admin')
    config.add_route('user_graphs', '/user_graphs')

    config.add_route('pyckauth_login', '/login')
    config.add_route('pyckauth_logout', '/logout')
    config.add_route('pyckauth_manager', '/auth')
    config.add_route('pyckauth_users', '/auth/users')
    config.add_route('pyckauth_permissions', '/auth/permissions')
    config.add_route('pyckauth_routes', '/auth/routes')

    add_admin_handler(config, DBSession, get_models(smpp5web), 'admin.', '/admin', AdminController)


    configure_app_routes(config)

    config.scan()

    return config.make_wsgi_app()
コード例 #5
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """

    load_project_settings()

    session_factory = UnencryptedCookieSessionFactoryConfig(
        settings.get('session.secret', 'hello'))

    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    config = Configurator(session_factory=session_factory, settings=settings)
    config.add_tween('giteverywhere.auth.authenticator')
    config.include('pyramid_handlers')
    config.add_view('pyramid.view.append_slash_notfound_view',
                    context='pyramid.httpexceptions.HTTPNotFound')
    config.add_static_view('static', 'static', cache_max_age=3600)

    config.add_route('home', '/')
    config.add_route('contact', '/contact')

    config.add_route('pyckauth_login', '/login')
    config.add_route('pyckauth_logout', '/logout')
    config.add_route('pyckauth_manager', '/auth')
    config.add_route('pyckauth_users', '/auth/users')
    config.add_route('pyckauth_permissions', '/auth/permissions')
    config.add_route('pyckauth_routes', '/auth/routes')
    #config.add_route('add_repo_names', '/add_repo_names')
    #config.add_route('display', '/display')
    config.add_route('view_repo_names', '/view_repo_names')
    #config.add_route('delete_product', '/delete/{repo_id}')

    add_admin_handler(config, DBSession, get_models(giteverywhere), 'admin.',
                      '/admin', AdminController)
    configure_app_routes(config)

    config.scan()

    return config.make_wsgi_app()