-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
55 lines (46 loc) · 1.56 KB
/
main.py
File metadata and controls
55 lines (46 loc) · 1.56 KB
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
import webapp2
import jinja2
import os
jinja_environment = jinja2.Environment(
loader = jinja2.FileSystemLoader(
os.path.dirname(__file__) + '/templates'))
image = "images/1.jpg"
class MainPage(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('index.html')
variables = {}
self.response.write(template.render(variables))
class About(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('about.html')
variables = {}
self.response.write(template.render(variables))
class Charities(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('charities.html')
self.response.write(template.render())
class Timer(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('timer.html')
global image
print image
variables = {
'image' : image,
}
self.response.write(template.render(variables))
class Donated(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('donated.html')
self.response.write(template.render())
class NotDonated(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('notdonated.html')
self.response.write(template.render())
app = webapp2.WSGIApplication([
('/', MainPage),
('/about', About),
('/charities', Charities),
('/timer', Timer),
('/donated', Donated),
('/notdonated', NotDonated),
], debug=True)