I've filed a ticket on this:
http://trac.turbogears.org/turbogears/ticket/461

Alberto wrote:

> Ok, thanks.
>
> If it helps, I've found a work-around:
>
> in start-myproj.py i've added:
> turbogears.update_config(configfile="devcfg.py")
> just before the if-elif-else clauses.
>
> So the problem was actually that config.py was importing model.py
> before the database connection was defined, as it's defined in
> devcfg.py.
>
> So something must be changed to fix it:
>
> a) the model module should be imported somewhere else, not in
> config.py, as the db connection does not "exist" yet
>
> b) update_config's behaviour so it import's the config (dev or prod)
> file BEFORE the module (config.py), it currently does the opposite.
>
> c) update the quickstart template to include my ugly-work-around-hack
> ;)
>
> I'm not familar with the new config style so I cannot make a reasonable
> judgement.
> 
> Hope it helps,
> Alberto.

Reply via email to