Last active
August 29, 2015 14:13
-
-
Save pandada8/1e612c02ae5765e6db39 to your computer and use it in GitHub Desktop.
Tornado snippet for serve static file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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