2008-11-14 67 views
2

是否有可能以編程方式獲取當前應用程序版本以用於具有遠期未來過期標題的網址?Google AppEngine應用程序版本

例如:

<link rel="stylesheet" href="app.js?v=1.23" /> 

應自動更新爲:

<link rel="stylesheet" href="app.js?v=1.24" /> 

爲了做到這一點我需要的版本。

回答

5

從[http://code.google.com/appengine/docs/python/theenvironment.html][1]

from google.appengine.ext import webapp 
import os 

class PrintEnvironmentHandler(webapp.RequestHandler): 
    def get(self): 
    for name in os.environ.keys(): 
     self.response.out.write("%s = %s<br />\n" % (name, os.environ[name])) 


    [1]: http://code.google.com/appengine/docs/python/theenvironment.html 
+0

謝謝!我一直在遍佈appengine網站,並且由於某種原因一直無法找到它。 – brad 2008-11-17 14:09:35

相關問題