title: Python App Engine : use app.yaml to control url handler
body: <p>When I control different type of pages, I move my code to another python file. But this way has disadvantage : each time I want to change url hander, I must comback to <code>main.py</code> to config bottom lines about url handler. for example : </p>
  
  <pre><code>app = webapp2.WSGIApplication([('/', MainPage),
                                 ('/thanks',ThanksHandler),
                                 ('/unit2/signup',Signup),
                                 ('/unit2/successful', LoginSuccess)], debug=True)
  </code></pre>
  
  <p>I try to config handler in <code>app.yaml</code> to prevent dis advantage. </p>
  
  <p>I add file <code>blog.py</code> in same directory and in this file, I have Blog class. And here is my <code>blog.py</code> file:</p>
  
  <pre><code>class Blog(BaseHandler):
      def get(self):
          self.response.out.write("Hello")
  
  app = webapp2.WSGIApplication([('/blog', Blog)], debug=True)
  </code></pre>
  
  <p>Here is original file:</p>
  
  <pre><code>&gt; handlers:
  &gt; - url: /favicon\.ico   static_files: favicon.ico   upload: favicon\.ico
  
  - url: /.*   script: main.app
  </code></pre>
  
  <p>and this new file <code>app.yaml</code>:</p>
  
  <pre><code>handlers:
  - url: /favicon\.ico   static_files: favicon.ico   upload: favicon\.ico
  
  - url: /blog/.*   script: blog.app
  
  - url: /.*   script: main.app
  </code></pre>
  
  <p>But when I goto: localhost:port/blog : 404: resource not found.</p>
  
  <p>Please help me.</p>
  
  <p>Thanks :)</p>