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 902425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:42:52+00:00 2026-05-15T15:42:52+00:00

I am new to database programming with Google App Engine and am programming in

  • 0

I am new to database programming with Google App Engine and am programming in Python. I was wondering if I am allowed to have one Python file with several request handler classes, each of which has get and post methods. I know that the yaml file allows me to specify which scripts are run with specific urls, like the example below:

handlers:
- url: /.*
  script: helloworld.py

How would I tell it to run a specific method that is in one of the classes in the .py file? Is that even possible/allowed? Do I need to separate the different request handler classes into different python files? My understanding of databases is rather shallow at the moment, so I could be making no sense.

Thanks.

  • 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-15T15:42:53+00:00Added an answer on May 15, 2026 at 3:42 pm

    I was wondering if I am allowed to
    have one Python file with several
    request handler classes, each of which
    has get and post methods.

    Sure! That app.yaml just transfers control to helloworld.py, which will run the main function defined in that file — and that function typically sets up a WSGI app which dispatches appropriately, depending on the URL, to the right handler class. For example, look at the sample code here, very early on in the tutorial:

    application = webapp.WSGIApplication(
                                         [('/', MainPage),
                                          ('/sign', Guestbook)],
                                         debug=True)
    
    def main():
        run_wsgi_app(application)
    
    if __name__ == "__main__":
        main()
    

    I’m not copying the import statements and class definitions, because they don’t matter: this is an example of how a single .py file dispatches to various handler classes (two in this case).

    This doesn’t mean the yaml file lets you call any method whatsoever, of course: rather, it hands control to a .py file, whose main is responsible for all that follows (and e.g. with the webapp mini-framework that comes with App Engine, it will always be get or post method [[or put, delete, …, etc, if you also support those — few do unless they’re being especially RESTful;-)]] being called depending on the exact HTTP method and URL in the incoming request.

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

Sidebar

Related Questions

I'm fairly new to database programming in WinForms, and have been using BindingSource, DataSet,
So I am fairly new to android programming. I have a database and I
I'm fairly new to database programming in .NET. If I want to call several
I am new to python (and programming in general) and am making a database/register
The android-app I'm programming is going to have a database of products, say 150-250
Im new to Database programming and I have a very basic question: In my
I am new to database programming and am using sqlite and python. As an
I am quite new to SQLAlchemy, or even database programming, maybe my question is
I'm new to iOS programming. I want to know how a database is created
I have an old database and a new database. The old records were converted

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.