Mercurial > piecrust2
comparison piecrust/serving.py @ 141:666ee97e77a9
Switch the PieCrust server to debug mode with `?!debug` in the URL.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 29 Nov 2014 18:29:19 -0800 |
parents | 1d8de8a349be |
children | 70b86e904b85 |
comparison
equal
deleted
inserted
replaced
140:63798c9e5a55 | 141:666ee97e77a9 |
---|---|
105 if self.static_preview and request.method != 'GET': | 105 if self.static_preview and request.method != 'GET': |
106 logger.error("Only GET requests are allowed, got %s" % request.method) | 106 logger.error("Only GET requests are allowed, got %s" % request.method) |
107 raise MethodNotAllowed() | 107 raise MethodNotAllowed() |
108 | 108 |
109 # Create the app for this request. | 109 # Create the app for this request. |
110 app = PieCrust(root_dir=self.root_dir, debug=self.debug) | 110 rq_debug = ('!debug' in request.args) |
111 app = PieCrust(root_dir=self.root_dir, debug=(self.debug or rq_debug)) | |
111 app.config.set('site/root', '/') | 112 app.config.set('site/root', '/') |
112 app.config.set('site/pretty_urls', True) | 113 app.config.set('site/pretty_urls', True) |
113 app.config.set('server/is_serving', True) | 114 app.config.set('server/is_serving', True) |
114 | 115 |
115 # We'll serve page assets directly from where they are. | 116 # We'll serve page assets directly from where they are. |