]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Merge pull request #896 from jniznan/master
authorbdarnell <ben@bendarnell.com>
Sun, 6 Oct 2013 00:32:23 +0000 (17:32 -0700)
committerbdarnell <ben@bendarnell.com>
Sun, 6 Oct 2013 00:32:23 +0000 (17:32 -0700)
Possibility to disable autoreload when debug is on

1  2 
tornado/web.py

diff --cc tornado/web.py
index 6c88ca4ec2e0e436ed38ea6a10ef34dd99749c41,caeb243b1d3228aff5c9cc6ea442908e72d6590d..7692de7534db20caa191c4a35ae7d3f3d9156dff
@@@ -1648,18 -1602,12 +1653,19 @@@ class Application(object)
                              args = [unquote(s) for s in match.groups()]
                      break
              if not handler:
 -                handler = ErrorHandler(self, request, status_code=404)
 +                if self.settings.get('default_handler_class'):
 +                    handler_class = self.settings['default_handler_class']
 +                    handler_args = self.settings.get(
 +                        'default_handler_args', {})
 +                else:
 +                    handler_class = ErrorHandler
 +                    handler_args = dict(status_code=404)
 +                handler = handler_class(self, request, **handler_args)
  
-         # In debug mode, re-compile templates and reload static files on every
+         # If template cache is disabled (usually in the debug mode),
+         # re-compile templates and reload static files on every
          # request so you don't need to restart to see changes
-         if self.settings.get("debug"):
+         if not self.settings.get("template_cache"):
              with RequestHandler._template_loader_lock:
                  for loader in RequestHandler._template_loaders.values():
                      loader.reset()