Skip to content

Instantly share code, notes, and snippets.

@pandada8
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandada8/1e612c02ae5765e6db39 to your computer and use it in GitHub Desktop.
Save pandada8/1e612c02ae5765e6db39 to your computer and use it in GitHub Desktop.
Tornado snippet for serve static file
class Redirector(StaticFileHandler):
def initialize(self, path, default_filename=None):
root, self.filename = os.path.split(path)
super(Redirector, self).initialize(root)
@coroutine
def get(self, include_body=True):
yield super(RedirectStaticFileHandler, self).get(self.filename, include_body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment