Sorry if this is obvious. I'm a total novice and don't understand much of the language used on the forum. I'm trying to convert from Python 2.5 to 2.7 but am getting the above error message. I've simply changed the app.yaml file to show python27, changed "main.py" to read "main.app" and added "2" to the word webapp within the main.py file. Any help would be much appreciated. main.py file:
import webapp2
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 = 'index.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 = webapp2.WSGIApplication ([('/(.*html)?', MainHandler)],
debug=True)
util.run_wsgi_app (application)
if __name__ == '__main__':
main ()
app.yaml file:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css))
static_files: \1
upload: (.*\.(gif|png|jpg|ico|js|css))
- url: .*
script: main.app