It is recommended that you add pyramid_redis_sessions to your pyramid app’s
setup.py file so that it will be automatically installed and managed. For
instance, in the setup call in your setup.py you can add
pyramid_redis_sessions to the requires list:

Alternately, instead of using the Configurator’s include method, you can
activate Pyramid by changing your application’s .ini file, use the
following line:

pyramid.includes=pyramid_redis_sessions

The above method is recommended because it’s simpler, idiomatic, and still fully
configurable. It even has the added benefit of automatically resolving dotted
python paths used in the advanced options (see Advanced Usage).

However, you can also explicitly pass a settings dict to the
session_factory_from_settings function. This can be helpful if you configure
or modify your settings in code: