谷歌AppEngine应用版本

3 投票
1 回答
781 浏览
提问于 2025-04-11 19:05

有没有办法通过编程的方式获取当前应用程序的版本,以便在带有很长过期时间的链接中使用?

举个例子:

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

这个应该自动更新为:

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

为了做到这一点,我需要获取版本信息。

1 个回答

6

来自于 http://code.google.com/appengine/docs/python/theenvironment.html

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

撰写回答