4 tempDir
= r
"c:\temp" if sys
.platform
== "win32" else "/tmp"
6 # where to listen for incoming fastcgi requests
7 # ex. ('localhost',XXXX) will listen on tcp port XXXX
8 # a filesystem path will try to listen on a UNIX Socket
10 defaultSocket
= ('localhost',7143)
12 baseUrl
= "http://localhost"
14 allowedServerNames
= ('localhost','192.168.1.101',)
16 # the directory to store the cache (for compressed pages, processed images, etc.)
17 # - this will see a LOT of activity so put it somewhere fast
18 # - it can be relative to the location of limo.py, or absolute
19 # - should not end in a "/"
22 # minutes before session cookies expire
25 # should the final html be prettify'd by BeautifulSoup (implies bufferOutput)
28 # will collapse all output to a single write
31 # enabling Etags support
34 # if enabled, requests to urls that lack a trailing slash will be redirected to a url that includes a trailing slash.
35 # http://localhost/foo -> http://localhost/foo/
36 # the app server sees no difference between the two URLS, but browsers generate relative URLs differently for each.
37 strictScriptNameRedirects
= True
39 # log all the incoming request headers
40 logRequestHeaders
= False
42 # log all outgoing response headers
43 logResponseHeaders
= False
45 # log the start times of each request
46 logRequestStartTime
= True
48 # logs what the load on the server is at the time of each request
51 # log the regions that render each page
52 logRequestRegions
= False
54 # log what kind of compression is used for each request
55 logCompression
= False
57 # VERY VERBOSE: logs every fastcgi packet in and out
58 logAllRequestTraffic
= False
60 # log the session token passed for each request
61 logSessionToken
= True
63 # show verbose 404 messages, including the real error
66 # logs messages like: Theme[default] => templates/block.tpl => theme/default/templates/block.tpl
67 # to let you know where files are coming from
70 # dumps a text sitemap to the log as the server starts up
73 # log messages when each module is loaded successfully (errors are always logged)
74 logModuleLoading
= False
76 # whether to profile anything at all
77 # if set to False, all calls to profile() will return None
78 # if true, every second call to profile('foo') returns the ms elapsed since the first call to profile('foo')
80 # should profile results be logged to the log file
81 profileLogOutput
= False
82 # will write every query in a request to the log file
83 profileLogQueries
= False
84 # if the current session has profile privileges, output profile data in html
85 profileHTMLOutput
= False
87 # if a theme cannot find a request file:
88 abortOnMissingFile
= False # raises 404 if some template is missing for that page
89 warnOnMissingFile
= True# print a message in the log when this happens
90 # NOTE: the page will render anyway, but with some content missing
92 # detect if a session token is used on one machine, and moved to another
93 # causes an extra query for every session load
94 detectSessionHijack
= False
96 disableAllLogging
= False
98 compressPerUserAgent
= (
99 ("iPhone OS", "gzip"),
104 def getCompression(UserAgent
):
105 for k
,v
in Settings
.compressPerUserAgent
:
106 if re
.search(k
, UserAgent
) is not None:
110 # controls a few things:
111 # - should tests be loaded at server start?
112 developmentMode
= True
115 if value
in (True,False,): # if they were actual boolean types already
117 # otherwise only deal with strings
118 assert type(value
) == str
120 while value
[0] == ' ':
122 while value
[-1] == ' ':
124 value
= value
.lower()
125 return (value
== '1' or value
== 'true')