Hi John,
Yes, moving this off of the michipug list is a good idea. I've cc'ed
the turbogears mailing list (which currently has one subscriber: me
:). I figure it's good to get something in there for archival
purposes.
On 9/16/05, John Miller <
john.mi...@gmail.com> wrote:
> Anyway, I'm having trouble connecting to a database, following the
> tutorial instructions. Here's what I get:
>
> gis:~ ics$ turbogears-admin.py sql create
> Database URI not specified in the config file (prod.cfg).
> Please be sure it's on the command line.
> gis:~ ics$
You need to run that command in the generated project directory.
turbogears-admin uses what it knows about quickstart project layout to
make life easier on you. It's possible that the tutorial wasn't clear
on the fact that you need to be in that directory. It's *certain* that
the errors message you've got there is a bad one, because the prod.cfg
file wouldn't even have been in the directory you were in.
>
> I get this for both MySQL and SQLite, configured in both prod.cfg and
> dev.cfg.
>
> The relevant config lines look like this:
>
> sqlobject.dburi="mysql://turbo:gears@localhost:3306/turbowiki"
> sqlobject.dburi="sqlite:///Users/ics/turbowiki/wikidata.db"
>
> (Also, dev.cfg has the additional line
>
> autoreload.package="turbowiki"
>
> at the top; prod.cfg doesn't.)
Yep, that all sounds right.
>
> Both 'mysql' and 'sqlite' work on the command line. So, I'm not sure
> how to troubleshoot this. Any ideas?
I haven't yet announced TurboGears to the world. I'm 90% certain it
will be up in the cheeseshop tomorrow, and will most likely get a
public announcement as well. One of the things I'm going to do is
update the documentation page with the additional docs I plan to write
and when I plan to have them there. Things like configuration and
turbogears-admin *need* some docs, because those docs would have made
this problem very easy for you to tackle.
>
> Also, in the tutorial at
>
http://www.turbogears.org/docs/wiki20/index.html I find the first class
> definition like so:
>
> class Page:
> pagename=StringCol(alternateID=True)
> data=StringCol()
> modified=DateTimeCol()
>
> However, it seems as though it ought to be:
>
> class Page(SQLObject):
> _connection = hub
> pagename=StringCol(alternateID=True)
> data=StringCol()
> modified=DateTimeCol()
That and the "modified" line shouldn't be there, because none of the
rest of the tutorial uses it. (In fact, the code to create a new page
would fail if it's there!)
I'm glad you caught that! You're the first person other than me to
actual run through the tutorial, and I really appreciate the cleanup
help you're providing.
Hopefully, with this message you'll be able to get all the way through
the tutorial.
Kevin