Some tips and tricks that helps when doing Plone development.
Debug-mode and Auto-Refresh - how to make Zope understand you've changed something
On a production Zope instance, you don't want zope to check if a file has been changed every time the file is used, since that would mean bad performance. In this case, it is often acceptable having to restart Zope to get an updated version of the software.
When developing, you most often want the opposite behaviour - changes to any file in the Product you develop should be detected by Zope at the next request made. Having to restart Zope is tedious, and eats a lot of precious developer time.
It's good practice to have several (at least two) Zope instances up and configured. One is used for development, and has the debug-mode activated. The second one is used for production, and is optimized for speed by disabling debug-mode.
The key to getting the second behaviour is to enable the debug-mode in zope.conf. The debug-mode is enabled by making sure this line is in zope.conf:
debug-mode on
This will make Zope automatically find out about changes to files in skins. It will however not make Zope automatically find out about changes in Python code that is not in the skins, for example Python code in a Product-specific tool. For this to work, you must make sure there is a file named refresh.txt in the Product's base directory. You must also go into the ZMI [1], find the product in the Products folder, and then go into the Refresh tab of the product and enable auto-refresh. Auto-refresh will only work if debug-mode is enabled.
| [1] | I'll explain what the ZMI is and where to find it in a later update to this document. |