You have to modify the tg_fastcgi.fcgi script for this to work
correctly. Add this to the top of the script:
import turbogears
And replace this:
if exists(join(code_dir, "setup.py")):
cherrypy.config.update(file=join(code_dir, "dev.cfg"))
else:
cherrypy.config.update(file=join(code_dir, "prod.cfg"))
With this:
if exists(join(dirname(__file__), "setup.py")):
turbogears.update_config(configfile=join(code_dir,
"devcfg.py"),
modulename="<project_name>.config")
else:
turbogears.update_config(configfile=join(code_dir,
"prodcfg.py"),
modulename="<project_name>.config")
NOTE: Make sure to replace <project_name> with your project name.
I've just upgraded my TG Dreamhost install from 0.88 to the latest SVN
version, but am in the process of debugging another issue with the new
install. I'll send another note when I've figured out my other issue
since it seems like it's related to the tg_fastcgi script.
Since I wrote the original instructions, I guess I should also update
TRAC when everything is working correctly.
Thanks,
Sean
Mike Sarahan wrote:
> Hi guys,
>
> I'm trying to move my site over to dreamhost, and I've followed the
> directions on the trac, with the deviation being that I went with SVN
> for identity's sake. I'm working with 518 on dreamhost. It's getting
> confused about the new style of config files. Here's the error:
>
> file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> 'def configure():\n'
> Traceback (most recent call last):
> File "tg_fastcgi.fcgi", line 21, in ?
> class VirtualPathFilter(object):
> File "tg_fastcgi.fcgi", line 74, in VirtualPathFilter
> tg_init()
> File "tg_fastcgi.fcgi", line 58, in tg_init
> cherrypy.config.update(file=join(code_dir,"devcfg.py"))
> File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 71, in update
> updateMap.update(dict_from_config_file(file))
> File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 221, in dict_from_config_file
> configParser.read(configFile)
> File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 209, in read
> self._read(fp, filename)
> File "/home/mikez0r/lib/lib/python2.4/ConfigParser.py", line 462, in
> _read
> raise MissingSectionHeaderError(fpname, lineno, line)
> ConfigParser.MissingSectionHeaderError: File contains no section
> headers.
> file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> 'def configure():\n'
> (END)
>
> Any ideas on what to change where to resolve this?
>
> Thanks,
> Mike