spyce
home
license
community
download
examples
resources
wishlist
contrib (@sf)
documentation
intro
lang
runtime
modules
tags
install
exits
sourceforge
statistics
freshmeat

Documentation - Runtime
[[ Spyce ]]
Python Server Pages
by Rimon Barr

Prev: 3.6 - Configuration Up: 3.6 - Configuration Next: 3.6.2 - path

3.6.1. Example configuration

###############
# 
# Spyce configuration file
#    -- an example
#
###############



###############
#
# The [spyce] section defines the main spyce configuration options
#

[spyce]

#
# The spyce path determines which directories are searched for when
# loading modules and tag libraries. The Spyce installation directory
# is always searched first. Any directories in the SPYCE_PATH
# environment are also searched.
#

#path: /usr/spyce/inc:/myapplication


#
# The import option can be used to pre-load various Python modules
# during engine initialization.
#

# import: myModule, myModule2


#
# The error option sets the server-level error handler; file-level
# error handling is defined within Spyce scripts using the error
# module. The format of this option is MODULE:FUNCTION. The server
# will call the error handler as: 
#   MODULE.FUNCTION(request, response, error)
# if a server-level error should occur.
#

#error: error:serverHandler


#
# The pageerror option sets the default page-level error handler.
# The format of this option is one of:
#   string:MODULE:VARIABLE
#   file:FILE
# where the lowercase words are literals.
#

#pageerror: string:error:defaultErrorTemplate


#
# The concurrency option is used for long-lived engines (i.e. not for
# CGI or command-line processing), and sets the concurrency level for
# the engine. Legal values are 'thread' (or 'threading') and 'fork'
# (or 'forking'). Any other value will result in serial request
# processing, which also is the default.
# 

#concurrency: thread
#concurrency: fork


# 
# The cache option affects the underlying cache mechanism that the
# server uses to maintain compiled Spyce scripts. The general format
# for this option is TYPE:INFO, where TYPE defines the cache handler
# and INFO is specific to that cache handler. Currently, Spyce
# supports two cache handlers:
#   - memory: the default, takes no parameters
#   - file: store compiled Spyce scripts to files on disk in some
#        directory; the INFO is the directory to use
#

#cache: file:/tmp


# 
# The debug option affects the caching of compiled Spyce files and
# Spyce modules. When it is turned on, then caching is disabled. It
# should NOT be used in a production environment, as compilation is
# not a optimized (fast) process. The values '0', 'off' or 'false'
# disable debugging. Any other value turns it on. The default, if
# omitted is off.
# 

#debug: 1



###############
#
# The globals section defines server-wide constants. The values can be
# arbitrary Python expressions. These values are evaluated and stored
# in a hashtable under the given option name. The hashtable is
# accessible as "pool.globals" within any Spyce file (with the pool
# method loaded), or as self.wrapper.server.globals within any Spyce
# module.
# 

[globals]

#name: "My Website"
#four: 2+2



###############
#
# The www section defines options for the built-in Spyce web server.
# 

[www]

# 
# The root option defines the document root of the webserver from
# which all requests are processed. This option can be overridden from
# the command-line. The default is the current directory when the
# server is started.
#

#root: /var/www/html


#
# The port option defines which TCP port the server will listen on.
# The default is port 80.
# 

#port: 8000


#
# The mime option is a comma-separated list of files. The files should
# be definitions of mime-types for common file extensions in the
# standard Apache format. The default is to read the spyce.mime file
# in Spyce installation directory.
#

#mime: /etc/mime.types


#
# The ext_ and ext_foo options define the default handler and the
# handler used for files ending in .foo, respectively. The currently
# supported handlers are:
#   spyce - process the file at the requested path a spyce script
#   dump  - transfer the file at the requested path verbatim, 
#     providing an appropriate "Content-type" header, if it is known.
# By default, all .spy files are processed via the spyce handler, and 
# all others through the dump handler.
#

#ext_html: spyce
#ext_: spyce


Prev: 3.6 - Configuration Up: 3.6 - Configuration Next: 3.6.2 - path


© 2002-06 Rimon Barr
email: rimon@acm.org
Spyce Powered SourceForge Logo [[ Spyce ]]
Python Server Pages
version 1.3.13