I read some tutorial in Google App Engine, in those tutorial there is same structure: each page point to each class, and ALL this class always same in main.py. I want to create new page on new file. So I do:
In project folder. I create hello folder, in this I create a simple script hello.py that has a class name Hello. For example this file is:
class Hello(webapp2.RequestHandler):
def get(self):
self.response.out.write('hello world')
app = webapp2.WSGIApplication([('/hello',Hello)], debug=True)
But when I run this app, when I point to : localhost:port/hello I will receive 404:Error Resource not found..
If I define in app.yaml. I cannot deploy this app:
- url: /hello
script: hello.app
So, please teach me how to run different file in different folder. in my example is hello.py and Hello Class in this file.
Try this:
The
scriptfield should be the complete path to the Python file that your handler lives in.