Creating zope3 applications is no easy task. This document comes out of a desire to help build a zope3 user community in support of SchoolTool and the CanDo competency tracking application which is being built on top of SchoolTool.
The goal here is to keep things as simple as possible. Zope3 is extremely complex, and the learning curve is steep to say the least. I'm assuming that the aspiring zope3 developer here will be using Ubuntu Dapper (or Edgy), and running their zope instance from their home directly on the port specified in their zope.conf file.
For the following commands, you will need sudo privileges:
make sure you have the following packages installed (sudo apt-get install subversion make gcc python-dev libc6-dev):
sudo svn co svn://svn.zope.org/repos/main/Zope3/trunk Zope3
sudo python test.py -v (to run all the tests. note use sudo python test.py -vpf1 if a test fails and you want to know which one.)
sudo ln -s /usr/local/src/Zope3/bin/mkzopeinstance /usr/local/bin/mkzopeinstance
Developers don't need sudo privileges for the following:
cd ~ (to get to your home directory)
For Directory: we will be using zope3 in the user's home directory (/home/<username>/zope3).
Choose a username for the initial administrator account (for example zopeuser).
- Select a password manager from among: Plain Text, MD5, and SHA1. (Text is least secure, SHA1 is most secure).
- Enter your password twice.
You should now have a zope3 directory inside your home directory containing an instance of zope3.
As the developer from your home directory, there are two easy ways to start your zope3 instance:
For testing new code use runzope. Messages and debugging information will applear in the console, and you will be able to see when zope fails to start. Keep in mind that when using runzope the application server will stop when you close the terminal from which it is run or interrupt it by typing Ctrl-C, so to keep the server running use zopectl start. When running with zopectl start, you can stop it with zopectl stop and check the status with zopectl status.
If there will be other zope instances running on your machine, the default port, 8080, may already be in use. To change the port on which your instance runs, do the following:
change the section:
<server> type HTTP address 8080 </server>to use the desired port.
Users should now be able to run your zope instance. To administer your instance, login with the username you chose earlier (e.g. zopeuser).
In order to be able to import and run your zope code from the command line, add the following to the bottom of your .bashrc file:
PYTHONPATH=/usr/local/src/Zope3/src:$HOME/zope3/lib/python export PYTHONPATH