Sergiusz Bazanski | be89707 | 2020-07-25 12:18:59 +0200 | [diff] [blame] | 1 | import jinja2 |
| 2 | import webapp2 |
| 3 | import os |
| 4 | |
| 5 | JINJA_ENVIRONMENT = jinja2.Environment( |
| 6 | loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), |
| 7 | extensions=['jinja2.ext.autoescape'], |
| 8 | autoescape=True) |
| 9 | |
| 10 | class LandingPage(webapp2.RequestHandler): |
| 11 | def get(self): |
| 12 | template_values = {} |
| 13 | template = JINJA_ENVIRONMENT.get_template('index.html') |
| 14 | self.response.write(template.render(template_values)) |
| 15 | |
| 16 | class Camp19Page(webapp2.RequestHandler): |
| 17 | def get(self): |
| 18 | self.redirect('https://events.ccc.de/camp/2019/wiki/Village:IXP') |
| 19 | |
| 20 | class PricingPage(webapp2.RequestHandler): |
| 21 | def get(self): |
| 22 | template_values = {} |
| 23 | template = JINJA_ENVIRONMENT.get_template('pricing.html') |
| 24 | self.response.write(template.render(template_values)) |
| 25 | |
| 26 | app = webapp2.WSGIApplication([ |
| 27 | ('/', LandingPage), |
| 28 | ('/cccamp19', Camp19Page), |
| 29 | ('/ccccamp19', Camp19Page), |
| 30 | ('/camp19', Camp19Page), |
| 31 | ('/camp', Camp19Page), |
| 32 | ('/cccamp', Camp19Page), |
| 33 | ('/ccccamp', Camp19Page), |
| 34 | ('/pricing', PricingPage), |
| 35 | ('/prices', PricingPage), |
| 36 | ('/price', PricingPage), |
| 37 | ], debug=False) |