mackenzie1331
mackenzie1331

Reputation: 21

website to deploy in appEngine not showing

Hello: so I am trying to deploy a website to appEngine when I run it with the launcher the log does not have any errors, however when I go to local host the page is blank. I was running this website in python2.5 before with no issues, can you see any errors?

App.yaml

application: myappname
version: 1
runtime: python27
api_version: 1
threadsafe: true

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

- url: .*
  script: main.app

- url: /(.*\.json)
  mime_type: application/json
  static_files: static/\1
  upload: static/(.*\.json)

libraries:
- name: webapp2
  version: latest

main.py

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

class MainPage(webapp2.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, {}))

app = webapp2.WSGIApplication([('/(.*html)?', MainPage)])

Upvotes: 0

Views: 42

Answers (1)

Dave W. Smith
Dave W. Smith

Reputation: 24956

Change the 3rd and 4th lines (you can combine them) to:

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

That is, webapp, not webapp2.

Upvotes: 1

Related Questions