How do I load a HTML index file from Python

4 views
Skip to first unread message

Vee Why

unread,
Nov 15, 2008, 6:56:40 PM11/15/08
to Google App Engine
I am a complete novice at using python, but can someone help me.

I want to load a Index.html home page to my Google App Engine page
using python.

based on the Google App Engine tutorial, I have this python script,
but want the page to load a HTML file called 'index.html', what do I
do?

My Python script
************************************

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
application = webapp.WSGIApplication(
[('/', MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()

************************************

Chenqun Hang

unread,
Nov 16, 2008, 8:46:38 PM11/16/08
to google-a...@googlegroups.com

Marzia Niccolai

unread,
Nov 17, 2008, 12:59:40 PM11/17/08
to google-a...@googlegroups.com
Hi,

Make sure you haven't listed your templates as static_dir/static_files in your app.yaml.  If you have, the templates can't be accessed in the Python code.

-Marzia
Reply all
Reply to author
Forward
0 new messages