Hi there,
How can I make my static-file root directories relative to my application root folder (instead of a hard-coded path)?
In accordance with CP instructions (http://www.cherrypy.org/wiki/StaticContent) I have tried the following in my configuration file:
tree.cpapp = cherrypy.Application(cpapp.Root())
tools.staticdir.root = cpapp.current_dir
but when I run cherrpy.quickstart(rootclass, script_name='/', config=config_file)
I get the following error
builtins.ValueError: ("Config error in section: 'global', option: 'tree.cpapp', value: 'cherrypy.Application(cpapp.Root())'. Config values must be valid Python.", 'TypeError', ("unrepr could not resolve the name 'cpapp'",))
I know I can do configuration from within the main.py file just before quickstart is called (eg. using os.path.abspath(os.path.dirname(file))), but I prefer using the idea of a separate configuration file if possible.
Any help would be appreciated (in case it is relevant, I am using CP 3.2 with Python 3.1)
TIA Alan