Ok I have been reading the cherrypy documents for sometime and have not found a simple example yet. Let say I have a simple hello world site, how do I store data? Lets say I want to store a = 1, and b =2 to a dictionary using cherrypy. The config files are confusing as hell. Anyone have very simple example of storing values from a simple site in cherrypy?
Here is my code what am I doing wrong? I made a tmp file c:/tmp, where is the config file, and or where do I put it? This code worked before I try adding config?
import cherrypy
import os
cherrypy.config.update({'tools.sessions.on': True,
'tools.sessions.storage_type': "file",
'tools.sessions.storage_path': "/tmp",
'tools.sessions.timeout': 60})
class Application:
def hello(self,what='Hello', who='world'):
cherrypy.session['a'] = 1
return '%s, %s!' % (what, who)
hello.explose=True
root = Application()
cherrypy.quickstart(root)