-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (26 loc) · 907 Bytes
/
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
import webapp2, logging
from google.appengine.api import users
from dashboard import DashBoard, DashBoardDevices, DashBoardLocations
from mapedit import MapEdit
from api import ApiGeofancy
class MainPage(webapp2.RequestHandler):
'HTML-view of all timeBooking'
def get(self):
user = users.get_current_user()
if user:
self.redirect('/dashboard')
else:
login_url = users.create_login_url('/')
greeting = 'You have to <a href="{}">sign in</a> to use this application'.format(login_url)
self.response.write(
'<html><body>{}</body></html>'.format(greeting))
#get
#MainPage
app = webapp2.WSGIApplication([
('/', MainPage),
('/dashboard', DashBoard),
('/mapedit', MapEdit),
('/configdev', DashBoardDevices),
('/configloc', DashBoardLocations),
('/api/(\d*)', ApiGeofancy),
], debug=True)