Skip to content

Instantly share code, notes, and snippets.

@slinkp
Forked from anonymous/gist:5016125
Created February 22, 2013 19:57
Show Gist options
  • Save slinkp/5016128 to your computer and use it in GitHub Desktop.
Save slinkp/5016128 to your computer and use it in GitHub Desktop.
Check out the tornado source.
Switch to the branch1.2.
Apply this patch:
diff --git a/website/website.py b/website/website.py
index 39b7aed..902be9a 100644
--- a/website/website.py
+++ b/website/website.py
@@ -49,6 +49,7 @@ settings = {
"template_path": os.path.join(os.path.dirname(__file__), "templates"),
"xsrf_cookies": True,
"debug": os.environ.get("SERVER_SOFTWARE", "").startswith("Development/"),
+ 'static_path': os.path.join(os.path.dirname(__file__), 'static'),
}
application = tornado.wsgi.WSGIApplication([
(r"/([a-z]*)", ContentHandler),
@@ -56,6 +57,7 @@ application = tornado.wsgi.WSGIApplication([
dict(url="http://github.com/downloads/facebook/tornado/tornado-0.1.tar.gz")),
(r"/static/tornado-0.2.tar.gz", tornado.web.RedirectHandler,
dict(url="http://github.com/downloads/facebook/tornado/tornado-0.2.tar.gz")),
+
], **settings)
@@ -65,4 +67,8 @@ def main():
if __name__ == "__main__":
- main()
+ #main()
+ import wsgiref.simple_server
+ # There seem to be some hardcoded 8888 references.
+ httpd = wsgiref.simple_server.make_server('', 8888, application)
+ httpd.serve_forever()
Run the server:
$ cd website
$ python website.py
In another terminal, fetch the content like so:
$ wget -nc -r -l9 -p -nH --no-parent --convert-links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment