7.1 The Configuration File

Draco uses the built-in configuration subsystem to read its system settings. This configuration subsystem can be used by the user too. In fact, the user is encouraged to make use of it.

There are two configuration files, a global one and a local one. The global configuration file is found in the Draco data directory (which was determined at installation time) and the local one is found in the document root of the web site. Both configuration files are called draco.ini and are of the ``.ini'' format.

Below is a fragment from a configuration file that illustrates the file format:

# This is a comment

[section1]

var1 = 10
var2 = 'test'

[section2]

var1 = [1, 2]

Empty lines and lines starting with a hash mark (#) are ignored. Assignments are of the form "name = value" where value needs to be a valid Python expression. Note that this is different from the regular ``.ini'' file format, where every value is a string. The variables from the Draco configuration file are typed and their type is determined by evaluating it as a Python expression.

The configuration file is divided into one or more sections. A new section is started with a "[sectionname]" line. Assignments belong to the current section or to the special system section "[__system__]" if no section has been defined yet. Draco exclusively uses the system section for its configuration settings.