diff --git a/README.md b/README.md index 33986703..18e8a364 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,21 @@ # ATST ## Installation + brew install python3 python3 -m venv .venv . .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt + +## Running (development) + + DEBUG=1 ./app.py + +## Notes + +tornado templates are like mustache templates -- add the +following to `~/.vim/filetype.vim` for syntax highlighting: + + :au BufRead *.html.to set filetype=mustache + diff --git a/app.py b/app.py new file mode 100755 index 00000000..8194ea46 --- /dev/null +++ b/app.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import tornado.ioloop +import tornado.web +import os + +class MainHandler(tornado.web.RequestHandler): + def get(self): + self.render("hello.html.to") + +def make_app(): + return tornado.web.Application([ + (r"/", MainHandler), + ], + template_path='./templates', + debug=os.getenv('DEBUG',False), + ) + +if __name__ == "__main__": + app = make_app() + app.listen(8888) + tornado.ioloop.IOLoop.current().start() diff --git a/templates/base.html.to b/templates/base.html.to new file mode 100644 index 00000000..cfa4c9a2 --- /dev/null +++ b/templates/base.html.to @@ -0,0 +1,14 @@ + + +
+