Introduction
While configuring CherryPy, you should remember that it separates global and application configurations. You must be careful to separate the configurations if you're deploying multiple applications at the same site, which more and more people are doing as Python web apps tend to decentralize. There is always just one "global config," but each app you deploy has its own "app config."
The configuration data format might be a Python dictionary, a filename, or an open file object.

Configuration files
CherryPy uses the built-in ConfigParser in Python when you specify a filename or file; to declare Application config, write each path as a section header and each entry as a "key: value" (or "key = value") pair:
[/path/to/my/page]
response.stream: True
tools.trailing_slash.extra = False
Combined Configuration Files
You can create a single configuration file with global and app entries if you only deploy a single application to both config.update and tree.mount and add the global entries to a configuration section called [global] (). Cherrypy.quickstart will provide the configuration to both locations on your behalf. However, you must separate the two configuration files/dicts as soon as you decide to add another application to the same site.
Separate Configuration Files
You need one file for general configuration and one for each application if you're deploying more than one in the same process. Application configuration is often given in a call to cherrypy.tree.mount and the global configuration is updated by executing cherrypy.config.update.
Generally speaking, you should specify the global configuration and mount each application with its unique configuration. Among other advantages, this enables you to configure global logging so that you may view the tracebacks if something goes wrong when attempting to mount an application. In other words, follow this sequence:
cherrypy.config.update({'environment': 'production',
'log.error_file': 'site.log',
})
cherrypy.tree.mount(root1, "", appconf1)
cherrypy.tree.mount(root2, "/forum", appconf2)
cherrypy.tree.mount(root3, "/blog", appconf3)
if hasattr(cherrypy.engine, 'block'):
cherrypy.engine.start()
cherrypy.engine.block()
else:
cherrypy.server.quickstart()
cherrypy.engine.start()
Values in config files use Python syntax
Every configuration entry has a key and value, such as a server.socket port = 8080. A Python object is always the value, and a name is always the key. This means that the value you are setting must have the same appearance as a Python int, for example, 8080, if it is an int. Like a Python string, the value must be quoted if it is a string. Similar to Python code, arbitrary objects can also be generated if they can be found or imported. Here is a more thorough illustration of a few of the various types:
[global]
log.error_file: "/home/fumanchu/myapp.log"
environment = 'production'
server.max_request_body_size: 1200
[/myapp]
tools.trailing_slash.on = False
request.dispatch: cherrypy.dispatch.MethodDispatcher()







