]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Document StaticFileHandler's default_filename option.
authorBen Darnell <ben@bendarnell.com>
Sun, 21 Jun 2015 18:08:21 +0000 (14:08 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 21 Jun 2015 18:08:21 +0000 (14:08 -0400)
tornado/web.py

index 802811b3779e06eff6f23e5617a39fda602c7b7e..219bc2a1fc4cc2c3262ee5a5d889c5b980cf5a5a 100644 (file)
@@ -2144,6 +2144,11 @@ class StaticFileHandler(RequestHandler):
     the ``path`` argument to the get() method (different than the constructor
     argument above); see `URLSpec` for details.
 
+    To serve a file like ``index.html`` automatically when a directory is
+    requested, set ``static_handler_args=dict(default_filename="index.html")``
+    in your application settings, or add ``default_filename`` as an initializer
+    argument for your ``StaticFileHandler``.
+
     To maximize the effectiveness of browser caching, this class supports
     versioned urls (by default using the argument ``?v=``).  If a version
     is given, we instruct the browser to cache this file indefinitely.
@@ -2155,8 +2160,7 @@ class StaticFileHandler(RequestHandler):
     a dedicated static file server (such as nginx or Apache).  We support
     the HTTP ``Accept-Ranges`` mechanism to return partial content (because
     some browsers require this functionality to be present to seek in
-    HTML5 audio or video), but this handler should not be used with
-    files that are too large to fit comfortably in memory.
+    HTML5 audio or video).
 
     **Subclassing notes**