forked from yiransheng/Option-Quotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.py
More file actions
29 lines (19 loc) · 791 Bytes
/
request.py
File metadata and controls
29 lines (19 loc) · 791 Bytes
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
"""
Base class for requests
"""
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.api import users
import defs
# -----------------------------------------------------------------------------
# Classes
# -----------------------------------------------------------------------------
class WebPageHandler(webapp.RequestHandler):
def get_template(self, template_name):
return os.path.join(os.path.dirname(__file__),
defs.TEMPLATE_SUBDIR,
template_name)
def render_template(self, template_name, template_vars):
template_path = self.get_template(template_name)
return template.render(template_path, template_vars)