I have one project of ours that uses our normal buildout structure (similar to https://github.com/plone/simple-plone-buildout), but I cannot get it to run in debug mode locally.
debug-mode = on, and even the
debug-mode on. I run the instance in the foreground, but Site Setup shows, "You are running in "production mode".", and I have to restart to see template changes.
I'm curious if anyone else has run into this, and could point me to something I might need to change.
What is in the end in your
%define INSTANCEHOME /Users/chrissy/projects/x/parts/instance
%define CLIENTHOME /Users/chrissy/projects/x/var/instance
# Main database
# Blob-enabled FileStorage database
# FileStorage database
# Temporary storage database (for sessions)
name temporary storage for sessioning
are you running it with
instance start or
Could it be that you have something that restarts the site automatically (when it goes down).
I would go to http://someserver:port/manage_main and shut id down. Then I would see if it is still available, if not start it as bin/instance fg (or zeoserver) and check
A story of debugging
OK, so I rolled up my sleeves, made great use of my
breakpoint() hammer, and dug deep into the code.
I initially avoided putting a breakpoint into Zope's
App/config.py because I didn't want it to be triggered too many times. During startup, I could see that debug_mode was always set to
True, but by the time I checked in Site Setup, it was
I scoured the project's omelette for every occurrence of
debug_mode, ignoring anything coming from tests (which do occasionally disable
So I eventually put that breakpoint into
App/config.py(31)getConfiguration(), because no other function was telling me where the problem was actually coming from
There was a lot of:
w at the prompt provided a long traceback, but I quickly noticed where it was pointing at some of our custom code that did the following import:
from Testing.ZopeTestCase import utils as z2_utils
And of course, this code from ZopeTestCase does indeed disable debug mode. The commit message with the change was, "Prevent tile lookup from polluting the request". Now to figure out if I can safely remove it