Reputation: 20409
I do the following
- url: /user/.*
script: script.py
And the following handling in script.py:
class GetUser(webapp.RequestHandler):
def get(self):
logging.info('(GET) Webpage is opened in the browser')
self.response.out.write('here I should display user-id value')
application = webapp.WSGIApplication(
[('/', GetUser)],
debug=True)
Looks like something is wrong there.
Upvotes: 6
Views: 636
Reputation: 169284
In app.yaml
you want to do something like:
- url: /user/\d+
script: script.py
And then in script.py
:
class GetUser(webapp.RequestHandler):
def get(self, user_id):
logging.info('(GET) Webpage is opened in the browser')
self.response.out.write(user_id)
# and maybe you would later do something like this:
#user_id = int(user_id)
#user = User.get_by_id(user_id)
url_map = [('/user/(\d+)', GetUser),]
application = webapp.WSGIApplication(url_map, debug=True) # False after testing
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()
Upvotes: 6