]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Typo, restore missing path setting, and mention the capturing group 260/head
authorAlan Hogan <contact@alanhogan.com>
Thu, 19 May 2011 02:51:31 +0000 (19:51 -0700)
committerAlan Hogan <contact@alanhogan.com>
Thu, 19 May 2011 02:51:31 +0000 (19:51 -0700)
website/templates/documentation.txt

index d68f378d848a902f64228833f1d4028b74134346..3807fdc9bb4fa1ca32951aa4ce7c0246762d10a3 100644 (file)
@@ -521,7 +521,7 @@ setting in your application:
     application = tornado.web.Application([
         (r"/", MainHandler),
         (r"/login", LoginHandler),
-        (r"/(apple-touch-icon(?:-precomposed)?\.png)", tornado.web.StaticFileHandler,
+        (r"/(apple-touch-icon\.png)", tornado.web.StaticFileHandler, dict(path=settings['static_path'])),
     ], **settings)
 
 This setting will automatically make all requests that start with `/static/`
@@ -532,8 +532,11 @@ directory (even though they don't start with the `/static/` prefix).
 
 In the above settings, we have explicitly configured Tornado to serve `apple-touch-icon.png`
 “from” the root with the `StaticFileHandler`, though it is physically in the static file directory.
+(The capturing group in that regular expression is necessary to tell
+`StaticFileHandler` the requested filename; capturing groups are passed
+to handlers as method arguments.)
 You could do the same thing to serve e.g. `sitemap.xml` from the site root.
-Of course, you can also avoid faking a root `apple-touche-icon.png`
+Of course, you can also avoid faking a root `apple-touch-icon.png`
 by using the appropriate `<link />` tag in your HTML.
 
 To improve performance, it is generally a good idea for browsers to