-
Notifications
You must be signed in to change notification settings - Fork 0
/
garden.py
50 lines (44 loc) · 2.02 KB
/
garden.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
import webapp2
import garden_common
import garden_handlers
app_config = {
'webapp2_extras.sessions': {
'cookie_name': '_simpleauth_sess',
'secret_key': garden_common.SESSION_KEY
},
'webapp2_extras.auth': {
'user_attributes': []
}
}
routes = [
webapp2.Route('/admin', handler='garden_handlers.AdminConsole',
name='admin-console', handler_method='AdminHome'),
webapp2.Route('/admin/plants', handler='garden_handlers.AdminConsole',
name='show-plants', handler_method='ShowPlants'),
webapp2.Route('/admin/upload_plants', handler='garden_handlers.AdminConsole',
name='add-plants', handler_method='AddPlants'),
webapp2.Route('/login', handler='garden_handlers.Authenticate',
name='login', handler_method='SignIn'),
webapp2.Route('/logout', handler='garden_handlers.Authenticate',
name='logout', handler_method='LogOut'),
webapp2.Route('/mygarden', handler='garden_handlers.User',
name='view-profile', handler_method='Main'),
webapp2.Route('/mygarden/create_garden', handler='garden_handlers.User',
name='create-garden', handler_method='CreateGardenForm',
methods=['GET']),
webapp2.Route('/mygarden/create_garden', handler='garden_handlers.User',
name='create-garden', handler_method='CreateGardenAction',
methods=['POST']),
webapp2.Route('/mygarden/delete', handler='garden_handlers.User',
name='delete-garden', handler_method='DeleteGarden'),
webapp2.Route('/mygarden/updateprofile', handler='garden_handlers.User',
name='edit-profile', handler_method='UpdateProfile'),
webapp2.Route('/', handler='garden_handlers.Main', name='main-page'),
# This next line should always be the last one
(garden_common.DECORATOR.callback_path,
garden_common.DECORATOR.callback_handler()),
]
app = webapp2.WSGIApplication(
routes,
config=app_config,
debug=True)