-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.py
32 lines (24 loc) · 865 Bytes
/
post.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 os
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp import util
from google.appengine.ext import webapp
from config import *
_DEBUG=True
class PostHandler(webapp.RequestHandler):
def get(self):
content=self.request.get('content')
template_values = {
'content': content,
}
cwd = os.path.dirname(__file__)
path = os.path.join(cwd, 'templates', 'postresult.html')
self.response.out.write(template.render(path, template_values, debug=_DEBUG))
application = webapp.WSGIApplication([
('/post', PostHandler)
],
debug=True)
def main():
#util.run_wsgi_app(application)
run_wsgi_app(application)
if __name__ == '__main__':
main()