def default_setup(config):
    from pyramid.session import UnencryptedCookieSessionFactoryConfig

    log.info('Using an unencrypted cookie-based session. This can be '
             'changed by pointing the "velruse.setup" setting at a different '
             'function for configuring the session factory.')

    settings = config.registry.settings
    secret = settings.get('session.secret')
    cookie_name = settings.get('session.cookie_name', 'velruse.session')
    if secret is None:
        log.warn('Configuring unencrypted cookie-based session with a '
                 'random secret which will invalidate old cookies when '
                 'restarting the app.')
        secret = ''.join('%02x' % ord(x) for x in os.urandom(16))
        log.info('autogenerated session secret: %s', secret)
    factory = UnencryptedCookieSessionFactoryConfig(
        secret, cookie_name=cookie_name)
    config.set_session_factory(factory)

    # setup backing storage
    storage_string = settings.get('store', 'memory')
    settings['store.store'] = storage_string
    store = create_store_from_settings(settings, prefix='store.')
    config.register_velruse_store(store)
Configure Velruse's session factory and backend storage.
dataset/ETHPy150Open bbangert/velruse/velruse/app/__init__.py/default_setup