-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
57 lines (51 loc) · 2.23 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
import sys
from secrets import SESSION_KEY
from webapp2 import WSGIApplication, Route
# inject './lib' dir in the path so that we can simply do "import ndb"
# or whatever there's in the app lib dir.
if 'lib' not in sys.path:
sys.path[0:0] = ['lib']
# webapp2 config
app_config = {
'webapp2_extras.sessions': {
'cookie_name': '_simpleauth_sess',
'secret_key': SESSION_KEY
},
'webapp2_extras.auth': {
'user_attributes': []
}
}
# Map URLs to handlers
routes = [
Route('/', handler='handlers.RootHandler', name='home'),
Route('/semantic', handler='handlers.Semantic', name='Semantic'),
Route('/add', handler='handlers.ProjectAdd'),
Route('/firm', handler='handlers.firms'),
Route('/delete_firm', handler='handlers.DeleteFirm'),
Route('/delete_project', handler='handlers.DeleteProject'),
Route('/delete_comment', handler='handlers.DeleteComment'),
Route('/delete_member', handler='handlers.DeleteMember'),
Route('/about', handler='handlers.About'),
Route('/invite', handler='handlers.Invite'),
Route('/privacy', handler='handlers.Privacy'),
Route('/google0e3609a4a19b9bdc.html', handler='handlers.VerifyGoogle'),
Route('/features', handler='handlers.Features'),
Route('/browse', handler='handlers.Browse'),
Route('/search', handler='handlers.Search'),
Route('/chrome', handler='handlers.Chrome'),
Route('/editfirm', handler='handlers.EditFirm'),
Route('/addfirm', handler='handlers.firms'),
Route('/add_firm_new', handler='handlers.add_firm'),
Route('/cadd', handler='handlers.CommentAdd'),
Route('/add_member', handler='handlers.AddFirmMember'),
Route('/projects', handler='handlers.ProjectsHandler', name='projects'),
Route('/profile', handler='handlers.ProfileHandler', name='profile'),
Route('/logout', handler='handlers.AuthHandler:logout', name='logout'),
Route('/<Firms>', handler='handlers.projects', name='firms'),
Route('/auth/<provider>',
handler='handlers.AuthHandler:_simple_auth', name='auth_login'),
Route('/auth/<provider>/callback',
handler='handlers.AuthHandler:_auth_callback', name='auth_callback')
]
app = WSGIApplication(routes, config=app_config, debug=True)