I'm a python newbie and I'm trying to build an app copying step by step what was taught earlier in my class, but I'm getting the "405 Method Not Allowed" error.
Here what the professor did:
Here what I did:
Could someone point me what in the code below is the cause of this error "405 Method Not Allowed"? I can not see difference between what I did and what the professor taught. The indentation is also ok (here is the main.py file https://docs.google.com/open?id=0B8TXLR_e14aCVDFfdlpYSU9DNDg).
Thanks in advance for any help!
Here my code:
form= """<html>
<head>
<title>Unit 2 Rot 13</title>
</head>
<body>
<h2>Enter some text to ROT13:</h2>
<form method="post" action="/rot13">
<textarea name="text"
style="height: 100px; width: 400px;"></textarea>
<br>
<input type="submit">
</form>
</body>
</html> """
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.out.write(form)
class Rot13Handler(webapp2.RequestHandler):
def post(self):
text = self.request.get("text")
self.response.out.write(text)
app = webapp2.WSGIApplication([('/', MainHandler), ('/rot13', Rot13Handler)],
debug=True)