Using Wing with Plone

Index of All Documentation » How-Tos » How-Tos for Web Development »

"The best solution for debugging Zope and Plone" -- Joel Burton, Member, Plone Team

Wing is a Python IDE that can be used to develop, test, and debug Python code written for the Plone content management system. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional programmers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for Plone. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.


The instructions below are for the Plone 4+ unified installer. If you are using an older version of Plone or use a source installation of Plone 4 that makes use of old style Products name space merging, please refer instead to the instructions for Using Wing with Zope.

Note: We strongly discourage running Wing or development instances of Plone as root or administrator. This creates unnecessary security risks and will cause debugger configuration problems.

Configuring your Project

To set up your project, simply set the Main Debug File in Project Properties to the file zinstance/bin/instance within your Plone installation. This may instead be zeocluster/bin/client1 with a ZEO install, or whatever name is given in the .cfg file. Wing will read the sys.path updates from that file so that it can find your Plone modules.

You may also need to set Python Executable in Project Properties (accessed from the Project menu) to the Python that is used in your Plone instance. For example, in a standalone install this may be Python2.7/bin/python or similar. The full path can be found by looking at the top of many of the scripts in zinstance/bin or zeocluster/bin.

For Plone 4+, do not use the Zope2 support in Project Properties under the Extensions tab. This is not needed unless your Plone installation still uses old style Product name space merging.

Debugging with WingDBG

To get debugging working you must install WingDBG, the Wing debugger product, from zope/WingDBG-6.1.2.tar in your Wing installation by unpacking it into zinstance/products (or zeocluster/products in a zeo install).

Then edit your etc/zope.conf to change enable-product-installation off at the end to instead read enable-product-installation on. In a zeo install this file is located at zeocluster/parts/client1/etc/zope.conf.

Finally, click on the bug icon in the lower left of the IDE window and turn on Accept Debug Connections so the debugger listens for connections initiated from the outside.

Then start Plone and go into the Management Interface from http://localhost:8080/ , click on Control Panel, and then on Wing Debug Service at the bottom. From here you can turn on debugging. The bug icon in lower left of Wing's window should turn green after a while and then any page loads via port 50080 (http://localhost:50080/) will be debugged and will reach breakpoints. This port and other debugger options are configurable from the WingDBG control panel.

WingDBG in buildout-based Plone 4 installations

In some new buildout-based Plone settings, WingDBG will not load until the buildout.cfg (generated by the template plone4_buildout) is edited to add the following just above [zopepy]:

products = ${buildout:directory}/products

Then rerun bin/buildout -N which will add a line like the following to your parts/instance/etc/zope.conf file:

products /path/to/your/products''

You will also need to add the specified products directory manually, and then place WingDBG in it.

WingDBG as an Egg

Encolpe Degoute has been maintaining a version of WingDBG that is packaged as an egg.

Creating an egg yourself is also possible as follows:

paster create -t plone Products.WingDBG

Then copy WingDBG/* to Products.WingDBG/Products/WingDBG.

Related Documents

Wing provides many other options and tools. For more information: