[Zope-dev] How to trigger Zope externally (mail)
Shane Hathaway
shane@zope.com
Wed, 26 Feb 2003 20:27:56 -0500
On 02/26/2003 07:16 PM, Ross Boylan wrote:
> I am working on a poll/survey type product and want to handle
> responses by email as well as the web. If you have any advice about
> the best architecture, I would appreciate it. I'm currently using
> Zope 2.5 on Linux, though it would be nice if the solution weren't too
> platform dependent.
My favorite solution is to run a short-lived ZEO client for each
incoming email. You just set the PYTHONPATH environment variable to
point to <zope>/lib/python (and INSTANCE_HOME if you need it), then in
your Python script you "import Zope; app = Zope.app()". "app" now has
unrestricted access to the whole database. When you're done,
get_transaction().commit() and exit the process. From what I've seen,
the ZEO connection setup overhead is usually less than one second.
Shane