Setting url in yaml file for google app engin (page not found) problem

I am new to python and am very happy to learn. I am building my first application in an engin application, and I do not quite understand why my yaml file does not resolve the URL that I configured.

here is the code

handlers: - url: .* script: main.py - url: /letmein/.* script: letmein.py 

so if I go to http: // localhost: 8080 / letmein / , I get a link that swears or the page was not found.

here is the python code i have in letmein.py

 from google.appengine.ext import webapp from google.appengine.ext.webapp import util class LetMeInHandler(webapp.RequestHandler): def get(self): self.response.out.write('letmein!') def main(): application = webapp.WSGIApplication([('/letmein/', LetMeInHandler)], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() 

in advance for your help!

+4
source share
1 answer

Your handlers are in the wrong order, as they should always be less general. Change to:

 handlers: - url: /letmein/.* script: letmein.py - url: .* script: main.py 

and it works.

+7
source

Source: https://habr.com/ru/post/1309861/


All Articles