I am trying to go from python2.5 to python 2.7 in google app engine.
I just cannot get index.html up and going. I get a blank webpage, and nothing more. index.html is in the same directory as the .yaml and .py files.
I cannot find out how to make it work, cause there is no such tutorials or examples or anything that tells you how to render index.html.
What I found are examples that write out 'Hello World!'. I've found some 'almost there'-examples, but it's not quite there.
Here are app.yaml and main.py
application: myapp
version: main
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.(gif|png|jif|jpg|jpeg|ico|js|css))
static_files: \1
upload: (.*\.(gif|png|jpeg|jpg|ico|js|css))
- url: .*
script: main.application
.
import os
import webapp2
from google.appengine.ext.webapp import template
class BaseHandler(webapp2.RequestHandler):
def render_template(self, filename, **template_args):
path = os.path.join(os.path.dirname(__file__), 'templates', filename)
self.response.write(template.render(path, template_args))
class IndexHandler(BaseHandler):
def get(self):
self.render_template('index.html', name=self.request.get('name'))
application = webapp2.WSGIApplication([
('/', IndexHandler),
], debug=True)