Skip to content

Instantly share code, notes, and snippets.

@kumarnitin
kumarnitin / tornado-static-file.py
Created July 4, 2012 23:49 — forked from didip/tornado-static-file.py
Tornado StaticFileHandler
class StaticFileHandler(RequestHandler):
"""A simple handler that can serve static content from a directory.
To map a path to this handler for a static data directory /var/www,
you would add a line to your application like:
application = web.Application([
(r"/static/(.*)", web.StaticFileHandler, {"path": "/var/www"}),
])