I've done a bit of googling and looked at the CherryPy docs but I'm wondering if there's a TurboGears API layer for setting it up (config file specification etc).
Cheers,
Justin
-----------------------------------------
Email sent from www.ntlworld.com
Virus-checked using McAfee(R) Software
Visit www.ntlworld.com/security for more information
CREATE TABLE session (
id varchar(40),
data text,
expiration_time timestamp
);
2) Set:
session_filter.on = True
session_filter.storage_type = "PostgreSQL"
in your .cfg file
2) Inside your controllers.py, (or any file that get's imported, you
need to make sure it runs before any request) set:
turbogears.config.update({'session_filter.get_db':get_db_for_sessions})
where get_db_for_sessions is a function that returns a connecction
object to your DB (sorry, no TG hubs here, needs to be a psycopg
conn. object. Something like:
def get_db_for_sessions():
import psycopg2
dsn = config.get('postgres.dsn')
return psycopg2.connect(dsn)
(you need a line at your .cf file like this:
postgres.dsn="dbname = db user=user password=passwd host=host")
This should get you started... The rest of the config options are
common to all the session storage backends.
HTH, Alberto
On 12/04/2006, at 13:11, <just...@ntlworld.com>