forked from aryanabuelna/JAKKD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
39 lines (30 loc) · 1.2 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
import webapp2
import jinja2
import os
the_jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
class EnterInfoHandler(webapp2.RequestHandler):
def get(self): # for a get request
the_variable_dict = {
"greeting": "Welcome!!!",
"adjective": "splendid"
}
locations_template = the_jinja_env.get_template('templates/locations.html')
self.response.write(locations_template.render(the_variable_dict))
class ShowMapHandler(webapp2.RequestHandler):
def get(self): # for a get request
mappage_template = the_jinja_env.get_template('templates/mappage.html')
the_variable_dict = {
"line1": "Hurrah for Utsab!",
"line2": "Hurrah!!!!!!!!",
"img_url": "http://www.atozpictures.com/admin/uploads/2016/11/cute-cockatiel-wallpapers.jpg"
}
self.response.write(mappage_template.render(the_variable_dict))
def post(self):
self.redirect("/showmap")
app = webapp2.WSGIApplication([
('/', EnterInfoHandler),
('/showmap', ShowMapHandler),
], debug=True)