Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72502

What is producing "405 Method Not Allowed" in this python code (google app engine)?

$
0
0

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: enter image description here

Here what I did:

enter image description here

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)

Viewing all articles
Browse latest Browse all 72502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>