Tuesday, June 5, 2012

Google App Engine: "We can not locate data file'

I am a beginner with google app engines. My goal is to port an existing webpage to GAE. The difficulty I am having centers around the location of the .js files. To get it to run on my local machine, I placed .js files in a static directory with references in the html like

<link href="/static/tblDz_Qs_clinical.js"....   

Everything works fine on my local machine, but when I deploy, I get a message that

 'we cannot locate the datafile  http://dermdudes.appspot.com/static/tblDz_Qs_clinical.js' 

Here is the main.py:

import os import webapp2 import jinja2   template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir), autoescape=False)  class Handler(webapp2.RequestHandler):     def write(self, *a, **kw):         self.response.out.write(*a, **kw)     def render_str(self, template, **params):         t = jinja_env.get_template(template)         return t.render(params)     def render(self, template, **kw):         self.write(self.render_str(template, **kw))  class MainHandler(Handler):     def get(self):         self.render('DD_querydriven2.html')  app = webapp2.WSGIApplication([('/', MainHandler)],                               debug=True) 

here is the app.yaml:

application: dermdudes version: 1 runtime: python27 api_version: 1 threadsafe: yes  handlers: - url: /static   static_dir: static  - url: .*   script: main.app  libraries: - name: webapp2   version: "2.5.1"  - name: jinja2   version: latest 

here is the reference in the html that is triggering the message:

<link href="/static/tblDz_Qs_clinical.js" type="application/json" rel="exhibit/data" /> 

If I can only get GAE to find the .js files then everything will be perfect. Thanks for your help.

etta james at last john king obama sings al green heidi klum and seal ohare airport etta james songs east west shrine game

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.