官术网_书友最值得收藏!

Introduction

This chapter has a twofold purpose:

  • The first and main one is to introduce several Python packages and Plone products that will help us during the development of any Plone project.
  • The second is to deepen our knowledge and skill in dealing with the buildout configuration files.

Although the latter is the core of the previous chapter, there will be lots of examples in the book (and especially in the following pages) that will help us get used to this technique.

Some of these developer-essential tools will be available only when running the Zope instance in debug-mode. To set this mode, we have two choices:

  • Changing debug mode parameter in configuration file
  • Running Zope instance in foreground mode

Changing debug mode parameter in configuration file

To change debug-mode parameter in the configuration file of our instance, do the following:

  1. Change debug-mode parameter under [instance] part of the buildout.cfg file:
    [buildout]
    
    ...
    
    [instance]
    ...
    debug-mode=on
    ...
  2. Build your instance again:
    ./bin/buildout
    

Alternatively, if you need a quick change, you can also modify debug-mode value in parts/instance/etc/zope.conf. However, bear in mind that its value will be overwritten the next time you build your instance.

Running Zope instance in foreground mode

The second and more direct option is to run the Zope instance in foreground mode. This will automatically launch Zope in debug-mode, no matter what your configuration files are. It will also keep open the Zope console to let us debug it with any of the pdb alternatives we are going to see.

In Linux run:

$ ./bin/instance fg

In Windows use:

> .\bin\instance fg

Note

From now on, we'll use the Linux command, but you'll need to use the appropriate one for your system.

We want to clarify, before going on, that all the tools we will use and install in our Zope instance will be included via buildout. Nevertheless, this doesn't mean that we are going to spoil or get our buildout.cfg dirty. As we will see in Writing a production buildout (in the last chapter), there are means to separate environment from production options in buildout files. So don't worry, relax and enjoy the show!

主站蜘蛛池模板: 财经| 大新县| 永城市| 化隆| 越西县| 高青县| 永清县| 阿荣旗| 海淀区| 牡丹江市| 基隆市| 五河县| 中超| 鄄城县| 抚宁县| 通山县| 特克斯县| 龙海市| 辉县市| 元江| 肥西县| 兴和县| 专栏| 武乡县| 额济纳旗| 阳泉市| 灵丘县| 承德市| 满城县| 邯郸县| 余庆县| 德钦县| 江油市| 离岛区| 长乐市| 泰顺县| 泗水县| 台前县| 昆明市| 大方县| 青川县|