forked from JobsDong/zhihudaily
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.wsgi
41 lines (29 loc) · 936 Bytes
/
index.wsgi
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""知乎日报
"""
__author__ = ['"wuyadong" <[email protected]>']
import sae
sae.add_vendor_dir("vendor")
import config
import tornado.wsgi
from base.handler import ErrorHandler
from daily.handler import DailyHandler
from search.handler import SearchHandler
from operation.handler import OperationHandler
class Application(tornado.wsgi.WSGIApplication):
def __init__(self):
handlers = [
(r'/', DailyHandler),
(r'/search', SearchHandler),
(r'/operation/(.*)', OperationHandler),
(r'/.*', ErrorHandler),
]
settings = {
"static_path": config.static_path,
"template_path": config.template_path,
"debug": config.debug,
}
tornado.wsgi.WSGIApplication.__init__(self, handlers, **settings)
app = Application()
application = sae.create_wsgi_app(app)