2015-06-23 82 views
0

我包括谷歌的angularjs腳本,但他們似乎並沒有與應用程序一起工作。如果我用互聯網瀏覽器直接打開html網頁,它可以正常工作。 該頁面只是一個簡單的測試與NG-模型,看看你所輸入的內容,並沒有打印{{名}}Angularjs不會與我的谷歌應用程序引擎配置

<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> 

這是應用程序:

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 = webapp.WSGIApplication ([('/(.*html)?', MainHandler)], debug=True) 
    util.run_wsgi_app (application) 

if __name__ == '__main__': 
    main() 

這是我的app.yaml

application: sixth-tribute-676 
version: 2 
runtime: python27 
api_version: 1 
threadsafe: no 

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

- url: .* 
    script: main.py 
+0

「它不起作用」不是很有用,你能更具體嗎? –

+0

控制檯日誌說什麼?任何有關未找到或類似的文件? –

+0

不,只有GET樣式表和html文件 –

回答

0

的問題是,我用template.render{{name}}消失。我應該在不呈現html的情況下提供服務。