-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.py
51 lines (41 loc) · 1.36 KB
/
home.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
40
41
42
43
44
45
46
47
48
49
50
51
import cgi
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.2')
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
import logging
import datetime
import hashlib
from google.appengine.ext.webapp import template
from gaesessions import get_current_session
from gaesessions import delete_expired_sessions
import settings
from models import *
class HomeIndex(webapp.RequestHandler):
def get(self):
template_values = {}
template_values['CDN_HOST'] = settings.CDN_HOST
path = os.path.join(os.path.dirname(__file__), 'templates/home/index.html')
logging.info("path %s" % (path))
self.response.out.write(template.render(path, template_values))
class HomeAbout(webapp.RequestHandler):
def get(self):
template_values = {}
template_values['CDN_HOST'] = settings.CDN_HOST
path = os.path.join(os.path.dirname(__file__), 'templates/home/about.html')
logging.info("path %s" % (path))
self.response.out.write(template.render(path, template_values))
application = webapp.WSGIApplication(
[
('/', HomeIndex),
('/home/about', HomeAbout),
],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()