These days, I learnt some knowledge about GAE based on python.
there are two files which is very important, the first one is app.yaml the other is main.py.
We should focus on main.py, where our source code stored there.
Somebody may get the bindError. Below is the instruction of how to deal with it.
you should terminate those port which is still in use. I recommend you using Pycharm IDE. pressing the red square button to terminate the on going program. Then you can perfectly solve this problem.
The source code of how to implement HTML file into GAE is as follows:
# coding=utf-8
import webapp2
def mainForm():
return """
<html>
<head>
<meta charset = 'utf-8'>
<title>客户信息表</title>
</head>
<body>
<h1>User Information</h1>
<form method = "post">
<p>First name : <input type = "text" name = "fname" /></p>
<p>Last name : <input type = "text" name = "lname" /></p>
<input type = "submit" value = "Save" />
</form>
</body>
</html>
"""
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.out.write(mainForm())
def post(self):
firstname = self.request.get("fname")
lastname = self.request.get("lname")
self.response.out.write("First Name: " + firstname + "\n")
self.response.out.write(" Last Name: " + lastname)
app = webapp2.WSGIApplication([
('/.*', MainHandler),
], debug=True)