First you need to get all the dependencies installed
On ubuntu, type the following:
sudo apt-get install python python-gtk2 python-zopeinterface python-psycopg2 python-imaging \ python-reportlab postgresql postgresql-client python-dateutil python-mako python-gudev \ python-poppler python-webkit python-twisted-core python-twisted-web librsvg2-common python-xlwt \ gettext intltool git git-review python-setuptools pep8 pyflakes python-mock pylint python-storm
Downloading the Stoq sources
This is easiest to do using the Stoq plugin for bzr.
It'll download the source for stoq, stoqdrivers and kiwi and help you setup the environment variables and other things needed to run stoq smoothly:
$ mkdir -p ~/.bazaar/plugins $ bzr branch lp:stoq-bzr ~/.bazaar/plugins/stoq [...] $ bzr stoq --setup Root [~/devel] <- [press enter here]
$ bzr stoq --create-mirror [...] $ bzr stoq stoq.launchpad.master [...]
Remember that you'll always need to run the last command before running stoq and stoqdbadmin.
You can configure postgresql in a few different way, the easiest is to just create a new database user. To be compatible with the wizard you'll need to create a user with the same username as yours.
On a Debian/Ubuntu system this is accomplished with:
sudo -u postgres createuser -ds $USER
For other systems, just su / sudo to the postgres user and run createuser -ds
When you created a user you need to create an initial stoq.conf, this is easiest to do by using the first time wizard in stoq. It will automatically run if you haven't started stoq before or if you have an empty ~/.stoq directory.
Then it's enough to just start stoq
--sql = show all sql commands --debug = run in pdb and enable a few debugging only features
Administrating the database
stoqdbadmin contains a couple of commands that will help the development and administration of your stoq database
Pass in -v se be more verbose.
Creates a database shell where you can type SQL commands.
Create a python console with a stoq environment fully setup where you for instance can manipulate domain objects.
Update the database schema to the latest version
Pass in the -b option to avoid creating a backup
Creates a new database.
Pass in the -e option to also create a set of examples, good for developer testing.
This is also used to remove the existing database, when you need to reset it for some reason. But be careful.
Now when you're done here, head over to Documentation and start learning how the different Stoq components are related.