
# Gears2Go project, in TurboGears

## -------- custom "setuptools" configuration

# we want to install Python "eggs" (packages) to
# site_dirs=/usr/local/lib/python2.4/site-packages

# set up for 'setuptools' install-location
#    ... "eggs" install to .cfg path 

 cat > ~/.pydistutils.cfg << EOF
[install]
install_lib = /usr/local/lib/python2.4/site-packages

[easy_install]
site_dirs = /usr/local/lib/python2.4/site-packages
EOF


## -------- installing TurboGears, on Linux / Unix

wget http://peak.telecommunity.com/dist/ez_setup.py

# install Python 'setuptools'
sudo  python2.4 ez_setup.py --script-dir /usr/local/bin -U setuptools

# update/install TG & dependent "egg" packages
sudo  easy_install -Uf http://www.turbogears.org/download/index.html
                    --script-dir /usr/local/bin TurboGears


# optional packages -- "from" PyPI
sudo  easy_install  -U  --script-dir /usr/local/bin Routes

sudo  easy_install  -U  --script-dir /usr/local/bin SQLAlchemy

## NOTE: you'll need a DB driver installed!
## pkgs for SQLite 3, on Ubuntu Linux "dapper":
##   python2.4-pysqlite2; libsqlite3-0; sqlite3

## -------- create a new TG Project, 'gears2go'

cd /usr/local/src/Python/Turbogears

tg-admin quickstart
Enter project name: gears2go
Enter package name [gears2go]: 

cd gears2go
python start-gears2go.py  # check it -- start the "Hello TurboGears" 

emacs dev.cfg		  # change the port to 2080 (or set DB-config, etc)


## -------- TG 'gears2go': "building the Model"

# edit the Model, create the tables ... add User, List, Item table-classes

emacs gears2go/model.py

tg-admin sql create    # creates DB-file 'devdata.sqlite'

sqlite devdata.sqlite
sqllite> .dump

## try out the Model

tg-admin shell


## -------- TG 'gears2go': controllers, templates

cd gears2go			# one more 'gears2go' folder, down
emacs controllers.py

cd templates
emacs master.kid		# "mold" the master-template, to your reqs

cp  welcome.kid category.kid
emacs users.kid			# create a Category display-template


