On 1/5/06, markc <[EMAIL PROTECTED]> wrote:
> . in dev.cfg comment out all sqlobject.dburi values
> . mv your_sqlite.db to "default.sqlite"
> . add to *-start.py -> "from os.path import *"
> . add to *-start.py -> "tg_path = dirname(realpath(__file__))"
> . add to /your_tg_install_path/turbogears/database.py line line ~10
> -> import __main__ as main
> . change /your_tg_install_path/turbogears/database.py line line ~142
> from -> dburi = cherrypy.config.get("sqlobject.dburi", None)
> to -> dburi = cherrypy.config.get("sqlobject.dburi",
> "sqlite://%s/default.sqlite" % main.tg_path)
> . start your *-start.py server
>
> Bingo! Hopefully somebody who knows how to will add something like this
> properly.
In TurboGears 0.9, in your -start script you can just do this:
from turbogears import database
database.set_db_uri("sqlite://%s/default.sqlite" % tg_path)
In 0.8, you can do:
cherrypy.config.update({'sqlobject.dburi' :
"sqlite://%s/default.sqlite" % tg_path})
Kevin