Build a minimal ZPublisher based distribution
Created by .
Last modified on 2003/08/05.
Introduction
I wanted to bundle up ZPublisher and ZServer
but I didn't want the rest of Zope, ie. ZODB
and the rest, so that I can operate in the old
style bobo-mode.
Steps
- You will need Zope 2.5
- Create a blank directory
- Copy the following directories from Zope 2.5
and place them in the blank directory
- lib/python/zLog
- lib/python/ZPublisher
- lib/python/zExceptions
- ZServer
- You will need the following files as well
- Modify z2.py and fix references to
swhome.
- In z2.py, create a variable called
CLIENT_HOME and point it to the directory
where log files will be created. For example:
CLIENT_HOME='var'
- Change MODULE=
Zope to the name of the module
you would like to publish. For instance 'TEST':
# TEST.py
"test module"
class TEST:
"test class"
def index_html(self, REQUEST):
"Obligatory doc string"
return "<HTML>HELLO!</HTML>"
def index_html():
"Obligatory doc_string"
return "<HTML>HELLO FROM THE MODULE!</HTML>"
def testme(REQUEST):
instance = TEST()
return TEST.index_html(REQUEST)
def shutdown():
"End"
import sys
sys.exit(0)
- Test the webserver:
* python z2.py -w80
* http://localhost/
* http://localhost/index_html
* http://localhost/testme
* http://localhost/shutdown
* http://localhost/testme
|