-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (32 loc) · 1.46 KB
/
main.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
import wsgiref.handlers
from google.appengine.ext import webapp
from ld.views import IndexHandler, ProfileHandler, RestaurantHandler,\
RestaurantInfoHandler, SuggestionHandler, AvatarHandler, RatingHandler,\
StatsHandler, HomeHandler, AdminHandler
from ld.emailhandler import EmailTaskHandler, IncomingMailHandler
from ld.cron import DailyCronHandler
from ld.signup import SignupHandler
from ld.models import RE_GROUPNAME
from ld.invite import InviteHandler, InviteLinkHandler
def main():
application = webapp.WSGIApplication([('/', IndexHandler),
('/signup', SignupHandler),
('/profile', ProfileHandler),
('/avatar', AvatarHandler),
("/task/email", EmailTaskHandler),
IncomingMailHandler.mapping(),
('/cron/daily', DailyCronHandler),
('/%s/stats' % RE_GROUPNAME, StatsHandler),
('/%s/restaurant-info' % RE_GROUPNAME, RestaurantInfoHandler),
('/%s/restaurants' % RE_GROUPNAME, RestaurantHandler),
('/%s/suggestions' % RE_GROUPNAME, SuggestionHandler),
('/%s/rate' % RE_GROUPNAME, RatingHandler),
('/%s/invite' % RE_GROUPNAME, InviteHandler),
('/%s/admin' % RE_GROUPNAME, AdminHandler),
('/invite/(\w+)', InviteLinkHandler),
('/%s/?' % RE_GROUPNAME, HomeHandler)
],
debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
main()