]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Turn on auto-reloading when 'debug' setting is given
authorBret Taylor <btaylor@gmail.com>
Fri, 18 Sep 2009 02:47:32 +0000 (19:47 -0700)
committerBret Taylor <btaylor@gmail.com>
Fri, 18 Sep 2009 02:47:32 +0000 (19:47 -0700)
demos/auth/authdemo.py
tornado/autoreload.py
tornado/web.py
tornado/wsgi.py

index 2a309f384e96fcc1c516ac7f6b8e29831bbbdaa5..e6136d1b5366293c4e806d1cb8bccba7a6fd5c33 100755 (executable)
@@ -35,8 +35,6 @@ class Application(tornado.web.Application):
         settings = dict(
             cookie_secret="32oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
             login_url="/auth/login",
-            google_consumer_key="www.tornadoweb.org",
-            google_consumer_secret="ZcyJGvEEFn82+h9/PWgBeB0E",
         )
         tornado.web.Application.__init__(self, handlers, **settings)
 
index e644023c4a264dfec6979566317795cab16210b5..583cdc96f50c1951d689bb1ed4d5c58a42324bad 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
-"""A module to automatically restart the server when a module is modified."""
+"""A module to automatically restart the server when a module is modified.
+
+This module depends on IOLoop, so it will not work in WSGI applications
+and Google AppEngine.
+"""
 
 import functools
 import ioloop
index a625e783864c0f47f64068d0c1e6b0e4e9a220f2..08047a4e30c7d899e050e3bfb6e89fc674eb9487 100644 (file)
@@ -854,7 +854,7 @@ class Application(object):
     and we will serve /favicon.ico and /robots.txt from the same directory.
     """
     def __init__(self, handlers=None, default_host="", transforms=None,
-                 **settings):
+                 wsgi=False, **settings):
         if transforms is None:
             self.transforms = [ChunkedTransferEncoding]
         else:
@@ -864,7 +864,7 @@ class Application(object):
         self.settings = settings
         self.ui_modules = {}
         self.ui_methods = {}
-        self._wsgi = False
+        self._wsgi = wsgi
         self._load_ui_modules(settings.get("ui_modules", {}))
         self._load_ui_methods(settings.get("ui_methods", {}))
         if self.settings.get("static_path"):
@@ -878,7 +878,7 @@ class Application(object):
         if handlers: self.add_handlers(".*$", handlers)
 
         # Automatically reload modified modules
-        if self.settings.get("auto_reload"):
+        if self.settings.get("debug") and not wsgi:
             import autoreload
             autoreload.start()
 
index 76a032fe756968c8ad75f95d87e31baf497c5b55..1dd02298ec368549dea5a442dac2d9d21c6c1afa 100644 (file)
@@ -69,8 +69,7 @@ class WSGIApplication(web.Application):
     """
     def __init__(self, handlers=None, default_host="", **settings):
         web.Application.__init__(self, handlers, default_host, transforms=[],
-                                 **settings)
-        self._wsgi = True
+                                 wsgi=True, **settings)
 
     def __call__(self, environ, start_response):
         handler = web.Application.__call__(self, HTTPRequest(environ))