准备工作
panjy
簡介
這速成材料假設讀者已熟習Python, Subversion, 以及一般網站知識 (HTML, servers, 等).
下載 Zope 3
這速成是使用 Zope pre-3.2 版本. 新的版本應該沒問題. 留意你需要 Python 2.4 及 Subversion 以取得 Zope 3 主幹版本.
要得到 Zope 的版本, 你可以使用這教材並跟隨指示 (如在視窗環境中, 用 "" 符號代替檔案名中的 "/" 符號):
mkdir zope3_quick_start cd zope3_quick_start svn checkout svn://svn.zope.org/repos/main/Zope3/trunk zope3
安裝
Linux
執行以下命令 (注意尾隨點號是命令的一部份):
cd zope3 python setup.py build_ext -i install_data --install-dir . cd ..
視窗
如果你已安裝適當的編譯器, 你可以在 Linux 使用以上命令
否則, 執行這些命令(注意尾隨點號是命令的一部份):
cd zope3 python setup.py install_data --install-dir . cd ..
然後下載 Tim Peter 的視窗 binaries 給 Zope 3 C 編碼code 及 跟隨網頁指示安裝 (確保你已得到 Python 2.4 版本): http://www.zope.org/Members/tim_one/
製造事件 (Make an instance)
Zope 3 使用事件 (instances) 來記錄伺服器(或 一組伺服器)的相關資訊 . 我們現在建設一個事件來應用:
python zope3/bin/mkzopeinstance
你將會透過這工具軟件完成以下對答:
Please choose a directory in which you'd like to install Zope 'instance home' files such as database files, configuration files, etc. Directory: instance Please choose a username for the initial administrator account. This is required to allow Zope's management interface to be used. Username: admin Please provide a password for the initial administrator account. Password: Verify password:
當你建成事件後, 修改後轉換至事件文件夾以及執行:
bin/runzope
你應該看到和以下相似的:
------ 2005-09-28T20:40:11 INFO PublisherHTTPServer zope.server.http (HTTP) started. Hostname: my-computer Port: 8080 ------ 2005-09-28T20:40:11 INFO PublisherFTPServer zope.server.ftp started. Hostname: my-computer Port: 8021 ------ 2005-09-28T20:40:11 INFO root Startup time: 5.538 sec real, 3.120 sec CPU
ZMI
如果你打開瀏覽器並連結至 http://localhost:8080 你將看到 ZMI (Zope 管理介面).
繼續並按 "Login" 右上角的連結. 輸入你在建立事件時設定的用戶名稱 以及密碼. 現在在按下右方 "Navigation" 之下的 [top] . 試試新增一些內容物件( Zope 3 事件名字在 ZMI 中是可見的). 留意新增"文件夾"(一個可以裝起其他內容物件的特別的內容物件) 後, 內容物件怎樣列成其結構.
ZMI 沒有什麼花巧, 這只是一個預設的 Zope 3 面柀(skin). 你可以修改你喜歡的, 或整個代替.
當你瀏覽 ZMI 完畢後, 返回視窗環境, 在那裏鍵入 "runzope" 及留意你每個瀏覽器的 request 也會在發生後顯示. 按下 Control-C 停止 Zope.
