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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:09:54+00:00 2026-06-03T06:09:54+00:00

I have an App Engine project structure setup as follows: ProjectRoot app.yaml index.yaml main.py

  • 0

I have an App Engine project structure setup as follows:

    ProjectRoot

    • app.yaml
    • index.yaml
    • main.py
    • static [directory]
      • index.html
    • app [directory]
      • script1.py
      • script2.py

My app.yaml looks like this

application: appname
version: 1
runtime: python27
api_version: 1
threadsafe: no

handlers:
- url: /(.*\.html)
  mime_type: text/html
  static_files: static/\1
  upload: static/(.*\.html)
  expiration: "1h"

# application scripts
- url: /app/(.+)
  script: main.py

# index files
- url: /(.+)/
  static_files: static/\1/index.html
  upload: static/(.+)/index.html
  expiration: "15m"

- url: /(.+)
  static_files: static/\1/index.html
  upload: static/(.+)/index.html
  expiration: "15m"

# site root
- url: /
  static_files: static/index.html
  upload: static/index.html
  expiration: "15m"

libraries:
- name: webapp2
  version: "2.5.1"

My main.py is simply the default ‘Hello World’ sample application:

#!/usr/bin/env python
import webapp2

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.out.write('Hello world!')

    #print("Executing script!")
app = webapp2.WSGIApplication([(r'/app/(.*)', MainHandler)],
                              debug=True)

Now, the static html can be accessed as expected. The url mapping to the main.py script specified in app.yaml works and I know that the script is getting executed. The trouble I am having is with the URL mapping to be specified to WSGIApplication in main.py. I want to be able to access the application script using the url: localhost:808x/app/something
I have already tried using the patterns:

r'/app/(.*)'
r'/(.*)'
r'/'
r'/app/'

None of the above patterns lead to the ‘get’ response handler being invoked (i.e. I don’t get the ‘Hello World’ response). I have tried gleaning what I am doing wrong from the documentation. I think it all boils down to my only just coming to grips with regular expressions. Would someone possibly be able to point me to what pattern I need to map the application handler to?

  • 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-06-03T06:09:56+00:00Added an answer on June 3, 2026 at 6:09 am

    How about this pattern?

    r'/app/.*'
    

    If there is any regexp grouping, you need arguments for the view function.

    Additionally, you need to add main() function in your main.py if you specify your script in the form like main.py. The main() function looks like:

    from google.appengine.ext.webapp.util import run_wsgi_app
    ...
    ...
    def main():
        run_wsgi_app(app)
    
    if __name__ == '__main__':
        main()
    

    You can also use this form:

    script: main.app
    

    With the latter form, you don’t need the main() function.

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

Sidebar

Related Questions

I have a html page in my Google app engine project. I have stored
I have a Python Facebook project hosted on Google App Engine and use the
I am working on a Google app engine project where I have saved some
I have my app engine project myproject.appspot.com hosted at myprojectsdomain.com. I want to permanently
I created one google app engine project. There I configured DWR(DirectWebRemoting). I have created
I have a working GWT-App Engine web project which works before I added the
I have a Google App Engine project imported in Eclipse. For some reason when
I setup a Google App Engine project in Eclipse. I added a root level
I have a google app engine project and i want to make my REST
Please forgive my naivette...a very fundamental question: I have a google app engine project

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.