MakeAppWorkDir is a script located in the bin directory of your webware installation. If you run it, it will create a working directory for your application, complete with config files, sample context, etc. You can then add a Lib directory and whatever other directories you need.
My directory structure looks like this:
/Webware /WebKit ... /MyWebSite /Cache /Configs /Contexts - I added this directory /SomeContext /SomeOtherContext /ErrorMsgs /Lib - I added this directory __init__.py - can be empty SitePage.py - SitePage class /Logs /Sessions /Static - I added this directory for static content to be served directly by Apache __init__.py - should contain: __all__ = ['Lib'] AppServer.bat Launch.py ...
From my servlets I can import Python modules like SitePage out of Lib using for example:
from Lib.SitePage import SitePage
The great thing about using a working directory created with MakeAppWorkDir is that you don't have to modify your webware directory at all. All configuration files are contained in your working directory in the Config subdirectory.
-- GeoffTalvola - 29 Oct 2001
How do you tell Webware where /MyWebSite is?
I had to do some simple changes to use the <nop>AppServer from this new working directory as a daemon.
the "webkit" script needs the path to the new "AppServer" script
the PID, needed for stopping Webware, now comes from the "<nop>AppServer" script comment the line "echo $! > $PID_FILE" from "webkit" in and change <nop>AppServer to:
#!/bin/sh /usr/bin/env python Launch.py ThreadedAppServer $* >> /usr/local/Webware/daemon/log/webkit 2>&1 & echo $! > /usr/local/Webware/daemon/webkit.pid
Hope this make sense :-)
-- StephanDiehl - 03 Jan 2002