summaryrefslogtreecommitdiff
path: root/cherrypy/tutorial
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2006-08-24 07:02:42 +0000
committerRobert Brewer <fumanchu@aminus.org>2006-08-24 07:02:42 +0000
commite8f50e034080ee4c9f97c503d1ce806fb2b51aea (patch)
tree57bcce766684de7ff4b91d4a6854a640aeea5a0a /cherrypy/tutorial
parent27d3a90cc608f4efa0e6b6ca1ba48a995356b5ef (diff)
downloadcherrypy-git-e8f50e034080ee4c9f97c503d1ce806fb2b51aea.tar.gz
Overhaul of config system:
1. New docstring for config module! 2. Put all entries into a config namespace. New deadlock, log, request and response namespaces. 3. Request and response entries now directly modify attributes of cherrypy.request and .response, and consumer code looks up those attributes, not config. This also allows interactive inspection of defaults. 4. Removed 'log_config' config entry. Use engine.on_start_engine_list.append(config.log_config) instead. 5. Old 'dispatch' entry is now 'request.dispatch'. 6. New log entries: log.error.file, log.error.function, log.access.file, log.access.function, log.screen. 7. 'server.max_request_body_size' is now 'request.max_body_size'. 8. environments now only apply to globalconf. 9. The 'development' environment has been removed, since its settings were all the default anyway. 10. The 'embedded' environment has been removed, since it duplicates the 'production' environment now. 11. There's a new 'test_suite' environment. 12. Removed log_file_not_found (from static.py). Something still needs to be done to config.wrap, so it can take dotted names as kwarg keys.
Diffstat (limited to 'cherrypy/tutorial')
-rw-r--r--cherrypy/tutorial/tut10_http_errors.py6
-rw-r--r--cherrypy/tutorial/tutorial.conf3
2 files changed, 3 insertions, 6 deletions
diff --git a/cherrypy/tutorial/tut10_http_errors.py b/cherrypy/tutorial/tut10_http_errors.py
index e57ec396..f6d29cf2 100644
--- a/cherrypy/tutorial/tut10_http_errors.py
+++ b/cherrypy/tutorial/tut10_http_errors.py
@@ -22,7 +22,7 @@ class HTTPErrorDemo(object):
def index(self):
# display some links that will result in errors
- tracebacks = cherrypy.config.get('show_tracebacks')
+ tracebacks = cherrypy.config.get('request.show_tracebacks')
if tracebacks:
trace = 'off'
else:
@@ -48,8 +48,8 @@ class HTTPErrorDemo(object):
def toggleTracebacks(self):
# simple function to toggle tracebacks on and off
- tracebacks = cherrypy.config.get('show_tracebacks')
- cherrypy.config.update({'show_tracebacks': not tracebacks})
+ tracebacks = cherrypy.config.get('request.show_tracebacks')
+ cherrypy.config.update({'request.show_tracebacks': not tracebacks})
# redirect back to the index
raise cherrypy.HTTPRedirect('/')
diff --git a/cherrypy/tutorial/tutorial.conf b/cherrypy/tutorial/tutorial.conf
index 3420f515..69ac7796 100644
--- a/cherrypy/tutorial/tutorial.conf
+++ b/cherrypy/tutorial/tutorial.conf
@@ -1,6 +1,3 @@
[global]
server.socket_port = 8080
server.thread_pool = 10
-environment = "production"
-# show_tracebacks = True
-log_to_screen = True