To make it easier for everyone to get started, I thought I'd publish my setup.
You'll need to dump a ZIP-archive of the packages you want to use in your application directory. Download zope.zip to get the basic necessities.
Put Guido's my_zipimport.py in the Python path and bootstrap the importer using the following code:
import my_zipimportYou'll probably want to look at Ian Bicking's instructions for getting a Pylons-based application set up and the customize it to point to an application factory such as this:
import sys
my_zipimport.install()
sys.path.insert(0, 'zope.zip')
import osThis is very preliminary, but should give some starting pointers. For an example on how a WSGI application can interact with the Zope publisher, you may want to look at ore.wsgiapp.
def application_factory(global_conf, zcml='site.zcml', devmode='off', **kwargs):
zcml_conf = os.path.join(global_conf['here'], zcml)
devmode = ( devmode.lower() in ('true', 'True', 'on') and True) or False
return getWSGIApplication(zcml_conf, devmode)
def getWSGIApplication(configfile, schemafile=None, features=()):
return WSGIPublisherApplication()
class WSGIPublisherApplication(object):
def __call__(self, environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
yield "Hello World!"
1 comments:
yes malthe nice
vudo + Goolge AE = Voodge
:)
Post a Comment