Zope3onUbuntu
These notes are on getting Zope3 setup with Ubuntu. (inspired by the ZopeOnUbuntu page).
The easiest way to get started is to use synaptic to install the zope3-sandbox package. More details will be added later.
Zope3 + MySQL
This combination is needlessly difficult.
A specification has been proposed here: https://features.launchpad.net/distros/ubuntu/+spec/better-zope3-support
A feture request has been filed here: https://launchpad.net/distros/ubuntu/+source/zope3/+bug/56853
Here is a braindump of more-or-less what is necessary to get this setup working:
I've elided starting and stopping the Zope3 process, the false starts, and dead ends.
- Install the zope3-sandbox package, which gets all dependencies for Zope3, and sets up a sandbox instance at /var/lib/zope3/instance/sandbox/ Add my Ubuntu login user to the 'zope' group (makes editing easier). Make sure the sandbox and all subfolders are writable by group:
- sudo chmod -R g+w /var/lib/zope3/instance/sandbox/
- sudo easy_install 'sqlobject' (this is because the Dapper package of SQLObject conflicts with SQLOS)
- sudo easy_install 'sqlos'
http://cheeseshop.python.org/pypi/sqlos/ From the tarball, extract the four files in /sqlos-0.2.1/includes/ to /var/lib/zope3/instance/sandbox/etc/package-includes/
After that, I had to do some fiddling to get the sample app included with SQLOS working with MySQL:
- Go to /var/lib/zope3/instance/sandbox/lib/python/ and do a subversion checkout of the MySQLdbDA trunk:
- svn co svn://svn.zope.org/repos/main/mysqldbda/trunk mysqldbda
<include package='mysqldbda' />
Edit /usr/lib/python2.4/site-packages/sqlos-0.2.1-py2.4.egg/sqlos/ftesting.zcml to use the 'mysql' DB adapter predefined in the file instead of the 'sqlite' one.
- Added a testdb to MySQL, and a testuser (with a password of testuser) with full privileges on that DB:
- mysqladmin --user=root -p create testdb
mysql> grant select, insert, update, create, alter, delete, drop ON testdb.* to testuser@localhost identified by 'testuser';
CREATE TABLE sample_person (
fullname varchar(50) NOT NULL default , username varchar(20) NOT NULL default , password varchar(20) NOT NULL default , id int(11) NOT NULL auto_increment, PRIMARY KEY (id)
- mysqladmin --user=root -p create testdb
After accomplishing all of that, Zope now has a new 'SQLObject MultiContainer' available that you can add through the web, and to which you can then add simple 'Person' objects that are persistent in the table. Adding a second container shows the same person objects as exist in the first. Deleting a person deletes the record. Deleting the containers does not.
After deleting all the added containers, deleting the sqlos.ftesting-configure.zcml file from /var/lib/zope3/instance/sandbox/etc/package-includes disables the sample app objects from being addable in Zope.
Requested enhancements
1) Add a package to Ubuntu for MySQLdbDA, so a subversion source checkout is not necessary (Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345831)
2) Updating SQLObject under Dapper to 0.7 in order to support SQLOS. (Edgy has the newer version)
3) Add a package to Ubuntu for SQLOS for gluing Zope3 and MySQL together via SQLObject.
Zope3onUbuntu (last edited 2008-08-06 16:32:49 by localhost)