Motivation

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.

Installation

For the following commands, you will need sudo privileges:

  1. make sure you have the following packages installed (sudo apt-get install subversion make gcc python-dev libc6-dev):

    • subversion
    • make
    • gcc
    • python-dev
    • libc6-dev
  2. cd /usr/local/src

  3. sudo svn co svn://svn.zope.org/repos/main/Zope3/trunk Zope3

  4. cd Zope3

  5. sudo make

  6. 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.)

  7. sudo ln -s /usr/local/src/Zope3/bin/mkzopeinstance /usr/local/bin/mkzopeinstance

Developers don't need sudo privileges for the following:

  1. cd ~ (to get to your home directory)

  2. mkzopeinstance

  3. For Directory: we will be using zope3 in the user's home directory (/home/<username>/zope3).

  4. Choose a username for the initial administrator account (for example zopeuser).

  5. Select a password manager from among: Plain Text, MD5, and SHA1. (Text is least secure, SHA1 is most secure).
  6. Enter your password twice.

You should now have a zope3 directory inside your home directory containing an instance of zope3.

Starting zope

As the developer from your home directory, there are two easy ways to start your zope3 instance:

  1. ./zope3/bin/runzope

  2. ./zope3/bin/zopectl start

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:

  1. edit ./zope3/etc/zope.conf

  2. 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).

Setting PYTHONPATH

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

External Documentation

  1. http://www.treefernwebservices.co.nz/hello.html

  2. http://zissue.berlios.de/z3/hello.swf

  3. http://www.benjiyork.com/quick_start/

  4. http://zissue.berlios.de/z3/Zope3In30Minutes.html

  5. http://worldcookery.com/files/jeffshell-todo

  6. http://python.taupro.com/Zope3Notes/HowToContentComponent

  7. http://www.ibiblio.org/obp/pyBiblio/zope3


LearningZope3 (last edited 2015-03-30 15:10:23 by knome)