2016-09-28 5 views
0

GAEアプリケーションとして次のコードを実行しています。私がアクセスしようとすると、Webapp2 Googleアプリケーションエンジンのルートが機能しない

class HomeHandler(webapp2.RequestHandler): 
    def get(self): 
     self.response.write('This is the HomeHandler.') 

class ProductListHandler(webapp2.RequestHandler): 
    def get(self): 
     self.response.write('This is the ProductListHandler.') 

class ProductHandler(webapp2.RequestHandler): 
    def get(self, product_id): 
     self.response.write('This is the ProductHandler. ' 
      'The product id is %s' % product_id) 

app = webapp2.WSGIApplication([ 
    (r'/', HomeHandler), 
    (r'/products', ProductListHandler), 
    (r'/products/(\d+)', ProductHandler), 
]) 

、唯一の「/」ルートは「これはHomeHandlerは」印刷している(https://myapp.appspot.com)取り組んでいます。私はhttps://myapp.appspot.com/productsにアクセスしようとすると、私は

を取得しています要求されたURL /製品は、このサーバー

で見つかりませんでした私は、サーバー側の開発に新しいです。私は間違って何をしていますか?

答えて

3

あなたのapp.yamlが間違って設定されている可能性があります。 url部分に.*が含まれていることを確認してください。

handlers: 
- url: .* 
    script: main.app 
関連する問題