I have Google App Engine application that I would like to bring Polymer components into. I thought the best way to start off would be to bring the initial Project into Google App Engine So I created my new Google App Engine Application using Google App Engine Launcher. I then created my application on Google App Engine.
the URL for this test application is http://polymertvshelp.appspot.com/
So I then moved the Polymer project into my folder and uploaded it into Google App Engine
The application works landing on the page that displays the
Hello world!
text.
So then I find a post that tells me some next steps but I am missing something. the Post URL
In the post Mike the author gave me the code for the main.py which I modified by deleting the following
import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
I then pasted Mike's code into the file
import random
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:
i = random.randint(1,11)
q = 'step-2/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, {}))
class GuideHandler(webapp.RequestHandler):
def get (self, q):
q = 'icgt-registration-guide.pdf'
path = os.path.join (os.path.dirname (__file__), q)
self.response.headers ['Content-Type'] = 'application/pdf'
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 ()
this is the only code that executes in this main.py file now
I also modified the app.yaml file so that it looks like
application: polymerxxxx
version: 2
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
- url: /components
static_dir: components
- url: /images
static_dir: images
I also modified the index.html in the step-2 folder by removing the .. in front of the relative paths.
When I run the application I now get 500 server error
Error: Server Error
The server encountered an error and could not complete your request. Please try again in 30 seconds.
I'm hoping someone can get me going because I sure would like to play with some of these components.
Regards,
Chris