-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcangkeman.py
33 lines (27 loc) · 1.21 KB
/
cangkeman.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
import webapp2
import random
import jinja2
import os
import json
with open('cangkems.json') as namefile:
names = json.load(namefile) + ["BOSOK", "GAK DI SEKOLAHIN", "GEDI", "JELEK", "KELINDAS TRUCK",
"MEMBLE", "PORNO", "MINTA DI INJAK", "KOYO TELEK",
"MINTA DI POTONG", "DI CIPOK ULAR", "KEMANA MANA", "TUKANG GOSIP",
"MINTA DI JILAT", "PENGEN DI ISEP", "DI EMUT ALUS",
"PENGEN DI TARIK", "PENGEN TAK OBRAL", "MANIS KAYAK BOKONG",
"BUTUH BELAIAN ALUS" ]
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
class MainPage(webapp2.RequestHandler):
def get(self):
template_values = {
'name':random.choice(names)
}
template = jinja_environment.get_template('index.html')
self.response.out.write(template.render(template_values))
class Cangkem(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('cangkem.html')
self.response.out.write(template.render())
app = webapp2.WSGIApplication([('/', MainPage),('/cangkem', Cangkem)],
debug=True)