-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (21 loc) · 691 Bytes
/
main.py
File metadata and controls
29 lines (21 loc) · 691 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
#!/usr/bin/env python
from google.appengine.dist import use_library
use_library('django', '1.2')
from google.appengine.api import memcache
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
class HelloWorldHandler(webapp.RequestHandler):
def get(self):
# Collect an HTML Template
path = os.path.join(os.path.dirname(__file__),'template.html')
# Write the response
self.response.out.write(template.render(path, {}))
application = webapp.WSGIApplication([
('/', HelloWorldHandler)
],debug=True)
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()