]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Documentation: Application(debug=True); autoreload limitations. 536/head
authorEvan Jones <ej@evanjones.ca>
Thu, 14 Jun 2012 19:34:42 +0000 (15:34 -0400)
committerEvan Jones <ej@evanjones.ca>
Thu, 14 Jun 2012 19:34:42 +0000 (15:34 -0400)
Application: Document debug=True and cross-link to the overview.
autoreload: Note that this can lose flags and fail if you touch sys.argv.

tornado/autoreload.py
tornado/web.py
website/sphinx/overview.rst

index 286782c7371e213ef6a1b94f456dcf507bfaf850..55a10d10cc5aa2ff2d6f2386fd3aa6477175f389 100644 (file)
@@ -24,6 +24,11 @@ and static resources.
 This module depends on IOLoop, so it will not work in WSGI applications
 and Google AppEngine.  It also will not work correctly when HTTPServer's
 multi-process mode is used.
+
+Reloading loses any Python interpreter command-line arguments (e.g. ``-u``)
+because it re-executes Python using ``sys.executable`` and ``sys.argv``.
+Additionally, modifying these variables will cause reloading to behave
+incorrectly.
 """
 
 from __future__ import absolute_import, division, with_statement
index a7c9637f8cd8b589ac00f1d9842cc9306348e960..a9bc5046fff0a96a7a3ac6a230f26ec1cd6ecbef 100644 (file)
@@ -1208,9 +1208,15 @@ class Application(object):
 
     .. attribute:: settings
 
-       Additonal keyword arguments passed to the constructor are saved in the
+       Additional keyword arguments passed to the constructor are saved in the
        `settings` dictionary, and are often referred to in documentation as
        "application settings".
+
+    .. attribute:: debug
+
+       If `True` the application runs in debug mode, described in
+       :ref:`debug-mode`. This is an application setting in the `settings`
+       dictionary, so handlers can access it.
     """
     def __init__(self, handlers=None, default_host="", transforms=None,
                  wsgi=False, **settings):
index 7ea7b68dc72db3b2a1b4a1f75ee783dca73163c5..b27e75088eb2753e4fa49240d85f7d2bdb090778 100644 (file)
@@ -957,6 +957,8 @@ the Google credentials in a cookie for later access:
 
 See the `tornado.auth` module documentation for more details.
 
+.. _debug-mode:
+
 Debug mode and automatic reloading
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -976,6 +978,12 @@ The automatic reloading feature of debug mode is available as a
 standalone module in ``tornado.autoreload``, and is optionally used by
 the test runner in ``tornado.testing.main``.
 
+Reloading loses any Python interpreter command-line arguments (e.g. ``-u``)
+because it re-executes Python using ``sys.executable`` and ``sys.argv``.
+Additionally, modifying these variables will cause reloading to behave
+incorrectly.
+
+
 Running Tornado in production
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~