The :func:`cherrypy.quickstart` approach is fine for a single application,
but lacks the capacity to host several applications with the server.
To achieve this, one must use the :meth:`cherrypy.tree.mount <cherrypy._cptree.Tree.mount>`
Play along with your other loggers
-Your application may
aobviously already use the :mod:`logging`
+Your application may obviously already use the :mod:`logging`
module to trace application level messages. CherryPy will not
interfere with them as long as your loggers are explicitely
named. This would work nicely:
The :mod:`cherrypy.config <cherrypy._cpconfig>` object is a dictionary and the
-update method merge the passed dictionary into it.
+update method merge the passed dictionary into it.
You can also pass a file instead (assuming a `server.conf`
- is not mean to be used to configure the application.
+ is not mean to be used to configure the application.
It is a common mistake. It is used to configure the server and engine.
-To configure your application, pass a dictionary or a file
-when you associate ther application to the server.
+To configure your application, pass in a dictionary or a file
+when you associate their application to the server.
You can add settings that are not specific to a request URL
-and retrieve them from your page handler as follow:
+and retrieve them from your page handler as follow:
is one of the most common mechanism used by developers to
+Sessions one of the most common mechanism used by developers to
identify users and synchronize their activity. By default, CherryPy
does not activate sessions because it is not a mandatory feature
to have, to enable it simply add the following settings in your
all of your current sessions will be lost. You can store them in memcached
or on the filesystem instead.
-Using sessions in your applications is done as follow:
+Using sessions in your applications is done as follow:
Refer to the :mod:`cherrypy.lib.sessions` module for more
details about the session interface and implementation.
ey you will learn about sessions expir icy.
+ Notably you will learn about sessions expir.
-Using a filesystem is a simple not
to lose your sessions
+Using a filesystem is a simple not lose your sessions
between reboots. Each session is saved in its own file within
CherryPy uses the :mod:`mimetypes` module to determine the
best content-type to serve a particular resource. If the choice
- is not valid, you can simply set more media-types as follow:
+ is not valid, you can simply set more media-types as follow:
-You can serve a single file as follow:
+You can serve a single file as follow:
CherryPy always requires the absolute path to the files or directories
- it will serve. If you have several static section to configure
+ it will serve. If you have several static section to configure
but located in the same root directory, you can use the following
you can tell a browser that a resource should be downloaded
onto the user's machine rather than displayed.
-You could for instance write a page handler as follow:
+You could for instance write a page handler as follow:
a built-in support for JSON encoding and decoding
+CherryPy has built-in support for JSON encoding and decoding
of the request and/or response.
-CherryPy provides support for two very simple authentication
+CherryPy provides support for two very simple authentication mechanism,
both described in :rfc:`2617`: Basic and Digest. They are most commonly
known to trigger a browser's popup asking users their name
CherryPy serves its own sweet red cherrypy as the default
`favicon <http://en.wikipedia.org/wiki/Favicon>`_ using the static file
-tool. You can serve your own favicon as follow:
+tool. You can serve your own favicon as follow: