Created
May 24, 2014 06:10
-
-
Save masazdream/1bc0412c7840951da2eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: UTF-8 | |
''' | |
Created on 2014/05/24 | |
@author: masahiro | |
''' | |
import cgi | |
from google.appengine.api import users | |
import webapp2 | |
MAIN_PAGE_HTML = """\ | |
<html> | |
<body> | |
<form action="/sign" method="post"> | |
<div><textarea name="content" rows="3" cols="60"></textarea></div> | |
<div><input type="submit" value="何か書いてください。"></div> | |
</form> | |
</body> | |
</html> | |
""" | |
class MainPage(webapp2.RequestHandler): | |
def get(self): | |
self.response.write(MAIN_PAGE_HTML) | |
class Guestbook(webapp2.RequestHandler): | |
def post(self): | |
self.response.write('<html><body>あたなの文章:<pre>') | |
self.response.write(cgi.escape(self.request.get('content'))) | |
self.response.write('</pre></body></html>') | |
application = webapp2.WSGIApplication([ | |
('/', MainPage), | |
('/sign', Guestbook), | |
], debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment