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)
# 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
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:
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"):
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()
"""
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))