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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:12:00+00:00 2026-05-27T23:12:00+00:00

I am new at this and am planning to move my stuff from a

  • 0

I am new at this and am planning to move my stuff from a paid web service to GAE (nothing dynamic just static pages). Believe me I have spent countless hours trying to make this work but am at an impasse whereby I achieve one result at the exclusion of another and visa versa.

I am sure it is a simple answer and that I am violating some basic principles. What I want is that the app engine page (mygaeid.appspot.com) delivers a static landing page such that other pages are available with the addition of a suffix e.g. mygaeid.appspot.com/oranges.html mygaeid.appspot.com/grapes.html etc.

I am unable to achieve this such that I either am able to get the other pages when I add the suffix e.g. mygaeid.appspot.com/apples.html; mygaeid.appspot.com/oranges.html but not the landing page OR with a slightly different yaml the landing page (mygaeid.appspot.com) works but there is no access to the other pages (mygaeid.appspot.com/oranges.html etc) that have a suffix.

The py file (abcdefg.py) is below and is common to the two different yamls that follow:

import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template

class MainHandler(webapp.RequestHandler):
  def get (self, q):
    if q is None:
      q = 'htmdir/apples.html'

    path = os.path.join (os.path.dirname (__file__), q)
    self.response.headers ['Content-Type'] = 'text/html'
    self.response.out.write (template.render (path, {}))


def main ():
  application = webapp.WSGIApplication ([('/(.*html)?', MainHandler)], debug=True)
  util.run_wsgi_app (application)

if __name__ == '__main__':
  main ()

Using the following yaml the landing page (mygaeid.appspot.com) works perfectly (delivering the content of apples.html), but I cannot access the page if I add a suffix e.g. mygaeid.appspot.com/apples.html or mygaeid.appspot.com/static/htmdir/apples.html etc, as soon as I add the suffix it does not work. In the directory (htmdir) I have placed apples.html along with other html pages e.g. oranges.html etc and I cannot access any of them with this yaml.

application: mygaeid
version: 1
runtime: python
api_version: 1

handlers:
- url: /(.*\.(html))
  static_files: static/htmdir/\1
  upload: static/htmdir/(.*\.(html))

- url: /css
  static_dir: css

- url: /js
  static_dir: js

- url: /images
  static_dir: images

- url: .*
  script: abcdefg.py

If I modify the yaml as follows then the landing page (mygaeid.appspot.com) does not work but when I add the suffixes then it works perfectly e.g. mygaeid.appspot.com/apples.html; mygaeid.appspot.com/oranges.html etc deliver the appropriate pages:

- url: /(.*\.(html))
  static_files: htmdir/\1
  upload: htmdir/(.*\.(html))

Finally if I dispense with the directories altogether and using the same abcdefg.py (without the directory) the following very simple yaml actually delivers the results I want but is very unruly as all the files are stuffed in the root directory.

application: mygaeid
version: 1
runtime: python
api_version: 1

handlers:
- url: /(.*\.(png|js|css))
  static_files: \1
  upload: (.*\.(png|js|css))

- url: .*
  script: abcedfg.py

any help would be much appreciated on figuring this out.
thanks


thanks wooble and thanks dave I went back yet again and carefully read the logs Wooble’s solution works but I needed to put the htmdir (that contains the html) inside a directory called static. GAE is a great (and free) solution for static websites

your help and feedback is very much appreciated

SiteDirectory
-mygaeid
  -static
    -htmdir
  -js
  -css
  -images
 app.yaml
 index.yaml
(py file was removed)
  • 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-27T23:12:01+00:00Added an answer on May 27, 2026 at 11:12 pm

    If you declare files as static in app.yaml, they are not available to your application’s handlers.

    However, if they’re really static, using the django template engine to “render” them is kind of silly; just add mappings in app.yaml to display the static files, including one to display apples.html for /:

    application: mygaeid
    version: 1
    runtime: python
    api_version: 1
    
    handlers:
    - url: /(.*\.html)
      static_files: static/htmdir/\1
      upload: static/htmdir/.*\.html
    
    - url: /css
      static_dir: css
    
    - url: /js
      static_dir: js
    
    - url: /images
      static_dir: images
    
    - url: /
      static_files: static/htmdir/apples.html
      upload: static/htmdir/apples\.html
    

    (no python files needed)

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

Sidebar

Related Questions

I am new to BOOST We are planning to move from ACE to BOOST
Im new to java and im planning on skipping this topic because even if
I am planning a new website with codeigniter using wordpress. this site will contain
I'm planning a new service for my ASP.NET MVC app and want to use
I'm planning on starting a new project, and am evaluating various web frameworks. There
I would like to start a new instance of a wcf service host from
We are planning to move from StarTeam to TFS for source control and are
This weekend, I'm planning to attempt to configure my new Mac Mini as a
I'm trying to build a new .NET C++ project from scratch. I am planning
I am new this sharepoint development and i have task in hand to do

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.