-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.py
54 lines (51 loc) · 1.86 KB
/
server.py
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
43
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
import tornado.web as t
import tornado.ioloop
import tornado.httpserver
from db import ConnectDB
from db import ConnectRDB
from config import app_config
from tornado_utils.routes import route
#handler module
import base
import handlers
import admin
import comet
class Application(tornado.web.Application):
def __init__(self):
# handlers = [
# ################用户页面#############
# (r'/people/([^/]+)', empty),
# ################愿望相关##############
# (r'/wish/pool', empty),
# (r'/wish/([^/]+)', empty),
# (r'/wish/([^/]+)/add', empty),
# (r'/wish/([^/]+)/edit', empty),
# (r'/wish/([^/]+)/delete', empty),
# (r'/wish/([^/]+)/reply', empty),
# ###############设置系统###############
# (r'/settings/profile',empty),
# (r'/settings/email',empty),
# (r'/settings/profile',empty),
# (r'/settings/acount',empty),
# ################通知系统##############
# (r'/notifications',empty),
# (r'/notifications/all',empty)
# ]
routed_handlers = route.get_routes()
routed_handlers.append(
tornado.web.url(r"/static/(.*)", t.StaticFileHandler,
app_config['static_path'])
)
routed_handlers.append(
tornado.web.url('/.*?', base.PageNotFoundHandler,
name='page_not_found')
)
settings = app_config
tornado.web.Application.__init__(self, routed_handlers, **settings)
self.session = ConnectDB()
self.r = ConnectRDB()
if __name__ == '__main__':
http_server = tornado.httpserver.HTTPServer(Application())
http_server.listen(80)
tornado.ioloop.IOLoop.instance().start()