Then we define a new configuration class called "Config" and inherit all settings from the default configuration we imported. Note that the class name must be "Config".

Next lines are the configuration options for the Config class. Note that each line must be indented by 4 spaces, tabs are not allowed. Moin will not run if you use wrong indentation.

A common configuration item is sitename - in most cases you don't want your wiki to have the default "Untitled Wiki" name. You can define any name you like in any language, but before you do that, read next section on unicode options.

If you followed the install instructions, the wiki will run without any other change, but you might want to change some values, like data_dir, data_underlay_diracl_rights_before and more. For most cases, setting all the values in the supplied wikiconfig.py file is enough.

Anything we do not define simply stays at moin's internal defaults which we inherited from DefaultConfig.

Unicode options

Important: to use unicode values, you must setup a correct coding line in the first line of your configuration file. Check that your editor is configured correctly.

Certain options must use unicode values. For example, the site name could contain German umlauts or French accents or be in Chinese or Hebrew. Because of this, you must use unicode strings for those items. Unicode strings are defined by prefixing the letter u to the string. Here are some examples:

Read the comments in the configuration file - they tell you which options must use Unicode values.

Notes:

You can't mix different encodings in the same file. If your coding line says iso-8859-1, all your characters, the whole file content, must be in that encoding.

If you use utf-8 encoding (or plain ascii), you don't have to use unicode strings, moin will decode your string correctly for you. New in 1.3.2.

International Setup

The default configuration file shipped with moin uses iso-8859-1 coding. This is fine for Latin languages like English or German, but not usable for non-latin languages. If you want to have non-latin characters in your configuration items, use utf-8 coding for the config file.

Set the first line of all configuration files to this line:

# -*- coding: utf-8 -*-

You need a text editor being capable of (and also really using) utf-8 encoding for editing the config files.

For ready made configuration in your language, see ConfigMarket. Read also the section about unicode options.

Configuration of multiple wikis

The moinmoin wiki engine is capable of handling multiple wikis using a single installation, a single set of configuration files and a single server process. Especially for persistent environments like twisted, this is necessary, because the twisted server will permanently run on a specific IP address and TCP port number. So for virtual hosting of multiple domains (wikis) on the same IP and port, we need the wiki engine to permanently load multiple configs at the same time and choose the right of them when handling a request for a specific URL.

To be able to choose the right config, moin uses config variable wikis located in the file farmconfig.py - it simply contains a list of pairs (wikiname, url-regex). Please only use valid python identifiers for wikiname (to be exact: identifier ::= (letter|"_") (letter | digit | "_")* - just try with a simple word if you didn't understand that grammar rule). When processing a request for some URL, moin searches through this list and tries to match the url-regex against the current URL. If it doesn't match, it simply proceeds to the next pair. If it does match, moin loads a configuration file named <wikiname>.py (usually from the same directory) that contains the configuration for that wiki. Internally, moin adds a catch all('wikiconfig', '.*') to the end of that list, so you do not need something like this in farmconfig.wikis.

farmconfig.py in the distribution archive has some sample entries for a wiki farm running multiple wikis. You need to adapt it to match your needs if you want to run multiple wikis.

For simpler writing of these help pages, we will call such a <wikiname>.py configuration file simply wikiconfig.py, of course you have to use the filename you chose.

Of course you have already adapted the wikis setting in farmconfig.py (see above), so we only give some hints how you can save some work. Please also read the single wiki configuration hints, because it explains config inheritance.

We now use the class-based configuration to be able to configure the common settings of your wikis at a single place: in the base configuration class (see farmconfig.py for an example).

The configs of your individual wikis then only keep the settings that need to be different (like the logo, or the data directory or ACL settings). Everything else they get by inheriting from the base configuration class, see moinmaster.py for a sample.

see single wiki configuration, the only difference is that we inherit from FarmConfig (that inherited from DefaultConfig) instead of directly using DefaultConfig

now we override show_hosts to be 0 - we want it for most wikis in our farm, but not for this one

we also override sitename, interwikiname and data_dir (the usual stuff)

Overview of configuration options

The following table contains default values and a short description for all configuration variables. Most of these can be left at their defaults, those you need to change with every installation are listed in the sample wikiconfig.py that comes with the distribution.

Starting with moin 1.3.1, some options must use unicode strings. Read the section about unicode options.

Most important page names. Users can add more names in their quick links in UserPreferences. To link to URL, use u"[url link title]", to use a shortened name for long page name, use u"[LongLongPageName title]". To use page names with spaces, use u"[page_name_with_spaces any title]" [list of Unicode strings]

nonexist_qm

0

Default for displaying WantedPages with a question mark, like in the original wiki (changeable by the user)

page_category_regex

u'^Category[A-Z]'

Pagenames containing a match for this regex are regarded as Wiki categories [Unicode]

page_credits

[...]

list with html fragments with logos or strings for crediting.

page_dict_regex

u'[a-z]Dict$'

Pagenames containing a match for this regex are regarded as containing variable dictionary definitions [Unicode]

Some values can only be set from MoinMoin/config.py (part of the MoinMoin code and thus GLOBALLY changing behaviour of all your wikis), but not from the individual wiki's config - you should only touch them if you know what you are doing:

Character Set

Moin uses unicode internally, and utf-8 for external output and input, like pages, html output and translation files. The external character set is defined in config.charset to utf-8. This setting is fine for all languages, as any character can be encoded in utf-8. You should not change this value, although technically it is possible.

Do not change config.charset. It is not tested and we can't support this.