mekell via Plone Community wrote at 2022-6-29 15:08 +0000:
After installing with Plone-5.2.8-UnifiedInstaller-1.0 as described above there is simply no bin\client1
You can look at plone.recipe.zope2instance.ctl.ZopeCmd.do_debug.
It implements bin/client1 debug.
It essentially starts Python, imports configure_wsgi, applies it
to the configuration file, then import Zope2 and assigns app = Zope2.app().
It seems that pywin32 must be pip-installed in Python 3.8 before the UnifiedInstaller creates its venv.
I removed Python 3.8 and installed it again, did pip install pywin32 and then windows_install.bat from UnifiedInstaller.
And then I created a file bin\my-zconsole.py with the following:
#!"c:\users\username\plone-5.2.8-zeo\py-3.8.10.final.0\scripts\python.exe"
import sys
sys.path[0:0] = [ ... ] # <- put here the same sys.path as in "bin\runwsgi-script.py"
from Zope2.utilities.zconsole import debug, debug_console
if __name__ == '__main__':
print("binding app ...")
app = debug("parts\client2\etc\zope.conf")
print("app bound.")
debug_console
I wrote a recipe for using IPython via zconsole to debug Plone (5.2.8) which works for Linux and Windows 10. See Using IPython with Plone. The buildout configation file is as follows:
@espenmn: Of course not. It could perfectly be client1 or have one single client (like in a standalone installation). In such a case you should rename client2 and the paths to whatever you need (client1 or instance etc.)
In my case I use client1 for the browser view and client2 for debugging.
This is why my example (see Using IPython with Plone) assumes a zeo Plone installation with 2 clients and client2 will be used for IPython.
@espenmn: The optional argument --clients is used by the UnifiedInstaller to specify the number of Zope clients you wish to create. This is the default if you create a Plone instance of type zeo. Please refer to the UnifiedInstaller Windows Documentation. This optional parameter is also available in the Linux installation.
Using two clients can be very usefull if you want to debug or run scripts on Plone and want to see the results in the browser. Or when you make changes in the Browser and want to inspect the changes in the backend. In such cases you start a client to serve the browser's requests and a second client to run scripts or debug. This is why my buildout uses client2, leaving client1 "unchanged" for listening to browser's requests.
Please keep in mind that strictly seen you will only actually debug the processes from the client your scripts are running on. Not the processes from the another client!