-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (28 loc) · 835 Bytes
/
Copy pathmain.py
File metadata and controls
42 lines (28 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
import logging
import uuid
import datetime
import re
import tornado.ioloop
import tornado.web
class BaseHandler(tornado.web.RequestHandler):
pass
class MainHandler(BaseHandler):
def get(self):
self.render("main.html")
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/", MainHandler),
]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
cookie_secret="",
debug=True
)
tornado.web.Application.__init__(self, handlers, **settings)
if __name__ == "__main__":
application = Application()
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()