sessionpyramidbeaker

configuring pyramid_beaker to use with mysql


i am using pyramid_beaker as session factory .I want to save session in mysql database.so i want to know how to configure that? i have gone through this http://docs.pylonsproject.org/projects/pyramid_beaker/en/latest/ but it does not solve my problem. it does not give clue where to write mysql username ,password etc.


Solution

  • pyramid_beaker is a thin wrapper around beaker which can pull the settings from your INI file into beaker. Beaker [1] itself which contains docs on how to use its various backends. For example, if you're using the beaker.ext.database backend, then you should set session.url = mysql://user:password@host:port/dbname just like any other SQLAlchemy connection string.

    [1] https://beaker.readthedocs.io/en/latest/configuration.html#options-for-sessions-and-caching