Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 868209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:06:07+00:00 2026-05-15T10:06:07+00:00

Scenario 1 This involves using one gateway route in app.yaml and then choosing the

  • 0

Scenario 1

This involves using one “gateway” route in app.yaml and then choosing the RequestHandler in the WSGIApplication.

app.yaml

- url: /.*
  script: main.py

main.py

from google.appengine.ext import webapp

class Page1(webapp.RequestHandler):
    def get(self):
        self.response.out.write("Page 1")

class Page2(webapp.RequestHandler):
    def get(self):
        self.response.out.write("Page 2")

application = webapp.WSGIApplication([
    ('/page1/', Page1),
    ('/page2/', Page2),
], debug=True)

def main():
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
    main()

Scenario 2:

This involves defining two routes in app.yaml and then two separate scripts for each (page1.py and page2.py).

app.yaml

- url: /page1/
  script: page1.py
- url: /page2/
  script: page2.py

page1.py

from google.appengine.ext import webapp

class Page1(webapp.RequestHandler):
    def get(self):
        self.response.out.write("Page 1")

application = webapp.WSGIApplication([
    ('/page1/', Page1),
], debug=True)

def main():
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
    main()

page2.py

from google.appengine.ext import webapp

class Page2(webapp.RequestHandler):
    def get(self):
        self.response.out.write("Page 2")

application = webapp.WSGIApplication([
    ('/page2/', Page2),
], debug=True)

def main():
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
    main()

Question

What are the benefits and drawbacks of each pattern? Is one much faster than the other?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:06:07+00:00Added an answer on May 15, 2026 at 10:06 am

    The only performance implication relates to the loading of modules: Modules are loaded on an instance when they’re first used, and splitting things up requires fewer module loads to serve a page on a new instance.

    This is pretty minimal, though, as you can just as easily have the handler script dynamically load the needed module on-demand – and that’s what many common frameworks already do.

    In general, app.yaml routing is designed for routing between distinct components or applications. For example, remote_api and deferred both have their own handlers. It’s perfectly reasonable, therefore, to have a single handler defined for your app that handles everything else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a similar scenario as this one: public class TestLinq2Xml { private XElement
The scenario is this We have two applications A and B, both which are
I have this scenario where I need data integrity in the physical database. For
we have this scenario: A server which contains needed data and client component which
The scenario is this. A web page contains: some DIVs whose visibility can be
I need to set up this scenario: A SQL Server 2005 database will create
How would you test this scenario? I've just started looking into NHibernate and having
This is a question for a WSS/SharePoint guru. Consider this scenario: I have an
How is it possible that .NET is finding the wrong MyType in this scenario?
I am trying to use JQuery in my ASP.Net 2.0 website in this scenario:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.